{"dist":{"shasum":"f0e21b9e03bbd813171c95041ffd7fc4da0e8098","tarball":"https://registry.npmjs.org/graphql-codegen-compiler/-/graphql-codegen-compiler-0.13.0-alpha.302ec857.tgz","fileCount":38,"integrity":"sha512-SWHngiVXSyveAUmHew1BRz5N7QClWL3MSrzv381pUxXvQXC4BfYxiESjMLDogyTT7c7Ag5w/R9Fe8zeEe+b2qg==","signatures":[{"sig":"MEUCIQCYDN5zcajw/kCVrEevFatz8u5T2k5A+AgZCC2kC6FwuAIgTjSnXY1hz4pdn2MeC/UgCjP32ctxijZtAWVcMcMHQ70=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":81227,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbs1BKCRA9TVsSAnZWagAAq8UQAILxMkVl+u46whQglse2\nwWTXUCYpmsj6+MXs1ETDalTWARQxKKaIPu8XSlzWg5U8bDrwHz+Fl/OwDeOo\nky2kXQn02tm/l0qw6ubeb99+XqB5TJGfn1mucGXQoAvs1lNE9khwmBeFaxS5\njZj5YOdv8zwHtYUR1Snjr9cSMcIBuic1oh7TQAjZs13ST/RvNOHKir0OdrDO\nTHeN49HmwVStYNA8f9PCGJTgzQDQSymXt3siRCczcroCeuAQmyyItSB6FCPZ\nNWk3Mk7cXV4wOtR1ti/PQ8Y70r9zFCbnwrM+YLlCZzPlllsvy6OSRDOVZYzV\nGmyt+aK06wkvgsTOJyTAxBBbLAnCXSxJHc0Rm9+SZNbDneSCQrwyT0PmZnKf\n6TZowENy2q5T8hw/4Ud6tc5MPfrbDUnnwZouGOZB3WHWPnGBH1Pv8nE24+tq\n0dxnhjo1F5l3suZlvDN2vHM6orC2NP5cV6I/VzQ+VLmZFaZZdZNzdjMeYbN0\n4JDqOipbeiS6F6/vdZjLcVtiBSSKCnmms6jqfjMN3u+rLB2Fw//1z6gaxcgc\nVR0N/0RZB6NLxz/AsMTWpmsjg6uWieBDe0vn/1IpV7OrxW1lRlSgZZe3UhDH\n1gYxie9wBVW4C6H1IT8q8F6zYUuA8Gr5cOIQ1FLyrYUXesqQ96FZwGMkAB/n\n4YaL\r\n=n1Ds\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"testRegex":"tests/.*\\.ts$","transform":{"^.+\\.(ts|tsx)$":"<rootDir>/tests/jest.typescript.js"},"testEnvironment":"node","moduleFileExtensions":["ts","tsx","js"]},"main":"./dist/index.js","name":"graphql-codegen-compiler","readme":"# `graphql-codegen-compiler`\n\nThis package compiles the output of [`graphql-codegen-core`](../graphql-codegen-core/README.md) along with [`GeneratorConfig`](../packages/graphql-codegen-core/src/types.ts#L239-L254) and [`Settings`](../graphql-codegen-core/src/types.ts#L261-L265), and compiles the template, returns an array of [`FileOutput`](../graphql-codegen-core/src/types.ts#L256-L259).\n\nThe main entry point of the package is `compile` method, and you can import it directly and use it without the CLI package.\n\nWe are using Handlebars as template compiler, with some custom Handlebars helpers that helps to generate GraphQL related code easily.\n\n## GraphQL-related Template Helpers\n\n### `toPrimitive(type: string)`\n\nAccepts a string with a GraphQL type and converts it to the language primitive as specified in the template config, if the type isn't a primitive - it just returns it.\n\nExample:\n\n```graphql\ntype MyType {\n  f1: String\n}\n```\n\n```handlebars\n{{#each types}}\n    Type {{ name }} fields:\n    {{#each fields}}\n        Field {{ name }} type is: {{ toPrimitive type }}\n    {{/each}}\n{{/each}}\n```\n\nOutput:\n\n```\nType MyType fields:\n    Field f1 type is: string\n```\n\n### `ifDirective(context: any, directiveName: string)`\n\nSpecial GraphQL helper that accepts _any_ GraphQL entity, and extracts the GraphQL Directives of the entity.\n\nThe compiled context is the arguments values of the entity.\n\nExample:\n\n```graphql\ntype MyType @addName(name: \"Dotan\") {\n  f1: String\n}\n\ndirective @addName(name: String!) on OBJECT\n```\n\n```handlebars\n{{#each types}}\n    Type name: {{ name }}\n    Extra name? {{#ifDirective this \"addName\"}}Yes! and the name is: {{ name }}{{/ifDirective}}\n\n{{/each}}\n```\n\nOutput:\n\n```\nType name: MyType\nExtra name? Yes! and the name is: Dotan\n```\n\n### `unlessDirective(context: any, directiveName: string)`\n\nThe opposite of `ifDirective`.\n\nExample:\n\n```graphql\ntype MyType {\n  f1: String\n}\n\ndirective @addName(name: String!) on OBJECT\n```\n\n```handlebars\n{{#each types}}\n    Type name: {{ name }}\n    Extra name? {{#unlessDirective this \"addName\"}}No!{{/unlessDirective}}\n\n{{/each}}\n```\n\nOutput:\n\n```\nType name: MyType\nExtra name? No!\n```\n\n### `withGql(type: string, name: string)`\n\nLocates GraphQL element of `type` with name `name`, use it if you need to access GraphQL specific element, for example \"MyType\" of \"type\".\n\nSuper useful when you need to access the actual object inside `withImports` or in any other case.\n\n```graphql\ntype MyType {\n  f1: String\n}\n```\n\n```handlebars\n{{#withGql \"type\" \"MyType\"}}\n    {{ name }}\n{{/withGql}}\n```\n\nOutput:\n\n```\nMyType\n```\n\n### `eachImport(context)`\n\nLocates all external uses of `context`, and returns an array of: `{ name: string, type: string, filename: string }`, so you can use it to create imports when generating multiple files.\n\n`context` can be any GraphQL available object.\n\n```graphql\ntype MyType {\n  f: OtherType\n}\n```\n\n```handlebars\n{{#eachImport this }}\nimport { {{ name }} } from './{{ file }}';\n{{/eachImport}}\n```\n\nOutput:\n\n```\nimport { OtherType } from './othertype.type';\n```\n\n### `toComment(str: string)`\n\nPrints a valid docstring comment as string with `/* ... */`, and also trims multiple lines into a single line.\n\nUseful for `description` field of GraphQL entities.\n\nExample:\n\n```handlebars\n{{toComment \"hi\"}}\n```\n\nOutput:\n\n```\n/** hi */\n```\n\n### `eachImport(element: any)`\n\nIterates over a calculated array of imports (file names) that in use by the `element`.\n\nExample:\n\n```handlebars\n{{#eachImport type}}\n    import { {{ name }} } from './{{file}}';\n{{/eachImport}}\n```\n\n## Other Template Helpers\n\n### `times(count: number)`\n\nReturns the template child string `count` times, the execution context of the child content is the i/times.\n\nExample:\n\n```handlebars\n{{#times 3}}\n    Hello {{ this }}!\n{{/times}}\n```\n\nOutput:\n\n```\nHello 0\nHello 1\nHello 2\n```\n\n### `for(from: number, to: number, incr: number)`\n\nSimilar to `for` loop.\n\nReturns the template child string amount of times according to `from` to `to` by increasing `incr`, the execution context of the child content is the i/times.\n\nExample:\n\n```handlebars\n{{#for 3 6 1}}\n    Hello {{ this }}!\n{{/times}}\n```\n\nOutput:\n\n```\nHello 3\nHello 4\nHello 5\n```\n\n### `limitedEach(from: number, to: number, incr: number)`\n\nSimilar to `for` loop.\n\nReturns the template child string amount of times according to `from` to `to` by increasing `incr`, the execution context of the child content is the i/times.\n\nExample:\n\n```handlebars\n{{#for 3 6 1}}\n    Hello {{ this }}!\n{{/times}}\n```\n\nOutput:\n\n```\nHello 3\nHello 4\nHello 5\n```\n\n### `toLowerCase(str: string)`\n\nReturn a lowercase version of the string.\n\nExample:\n\n```handlebars\n{{toLowerCase \"Hello\" }}\n```\n\nOutput:\n\n```\nhello\n```\n\n### `toUpperCase(str: string)`\n\nReturn an uppercase version of the string.\n\nExample:\n\n```handlebars\n{{toUpperCase \"Hello\" }}\n```\n\nOutput:\n\n```\nHELLO\n```\n\n### `toSnakeCase(str: string)`\n\nReturn an [snake case](https://en.wikipedia.org/wiki/Snake_case) version of the string.\n\nExample:\n\n```handlebars\n{{toSnakeCase \"doSomething\" }}\n```\n\nOutput:\n\n```\ndo-something\n```\n\n### `toTitleCase(str: string)`\n\nReturn an [title case](http://www.grammar-monster.com/lessons/capital_letters_title_case.htm) version of the string.\n\nExample:\n\n```handlebars\n{{toTitleCase \"doSomething\" }}\n```\n\nOutput:\n\n```\nDo Something\n```\n\n### `toCamelCase(str: string)`\n\nReturn an [camel case](http://wiki.c2.com/?CamelCase) version of the string.\n\nExample:\n\n```handlebars\n{{toCamelCase \"DoSomething\" }}\n```\n\nOutput:\n\n```\ndoSomething\n```\n\n### `multilineString(str: string)`\n\nConverts a multiline string into a string with line breaks, to prevent code from being broken.\n\nExample:\n\n```handlebars\n{{toCamelCase \"myString\nother line\" }}\n```\n\nOutput:\n\n```\n\"myString\" +\n\"other line\"\n```\n\n### `ifCond(p1: any, comparator: string, p2: any)`\n\nExecutes a simple if command of two parameters, using comparator.\n\nAvailable comparators: `===`, `==`, `!==`, `!=`, `<`, `<=`, `>`, `>=`, `&&`, `||`.\n\nExample:\n\n```handlebars\n{{#ifCond \"test\" \"===\" \"test\"}}\n   Hi!\n{{/ifCond}}\n```\n\nOutput:\n\n```\n    Hi!\n```\n","license":"MIT","scripts":{"lint":"tslint src/**/*.ts","test":"jest","build":"tsc","prebuild":"rimraf ./dist/"},"typings":"dist/index.d.ts","_npmUser":{"name":"dotansimha","email":"dotansimha@gmail.com"},"repository":{"url":"git@github.com:dotansimha/graphql-code-generator.git","type":"git"},"typescript":{"definition":"dist/index.d.ts"},"description":"GraphQL code generator compiler","directories":{},"maintainers":[{"name":"dotansimha","email":"dotansimha@gmail.com"}],"dependencies":{"moment":"2.22.2","handlebars":"4.0.12","change-case":"3.0.2","common-tags":"1.8.0","@types/handlebars":"4.0.39","graphql-codegen-core":"0.13.0-alpha.302ec857"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/graphql-codegen-compiler_0.13.0-alpha.302ec857_1538478153343_0.2518654701366836","host":"s3://npm-registry-packages"},"_id":"graphql-codegen-compiler@0.13.0-alpha.302ec857","version":"0.13.0-alpha.302ec857"}