{"bugs":{"url":"https://github.com/ardatan/graphql-toolkit/issues"},"dist":{"shasum":"63a82c32bea5d2d105ce7f0387666b46869d09c3","tarball":"https://registry.npmjs.org/@graphql-toolkit/graphql-tag-pluck/-/graphql-tag-pluck-0.10.4-alpha-e78d594.8.tgz","fileCount":12,"integrity":"sha512-rHul9zWMP8h5CCtt478ZOw259kEjGc8kpox/OXT1OznuSy98oAPZ6s9aHlOYuni2BxN86s+dEd0/ZwuCwvt1gw==","signatures":[{"sig":"MEUCIQDWtf0C/7VQ4GaIP8LoMPZxjcfhk3JKjdRjQavndcvJTwIgMS9cLaTCp0lI2qBc01wDJq53xqEIoDU0N9k1zi2XIYA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":94536,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJela7WCRA9TVsSAnZWagAAYr8P/1P+IK836R44f253shSj\nQriG1F+jNh8AURFDQVxkUmCbDDHMuMjGx7Uf1+YKOoCz5mFW+2P6MGZ9GCHG\n10i1+PoZVY93Te8iodz8JH2DSzOVQ+0y9rdRDc54HtXZJRQPu/5TqqZnIiNn\naH3b8vkIskYNYr5ct6AUMw9kxTzjziiL3qIHJRhiy+2pYMUQgBZkFXG1KrEm\nxPnHJK+F2mkCtx0h8JEhBV1fVyzgG2yMnLkOpzKm6TtLKzHtiWTE9c10saB9\nYAtagd85lYohBQnpy3X95xUFJ1jZVlBr4zgxRUQ6KTZjr8+P2vBNQG/dVMSD\nL9c8MNpUKtNEEblA4LkAR1qFKV80mnYzGFeABIpuDWbp/wHwwsbLeLpzBBis\nQf0d/oOJek0NifdPqHJKsGmFU3roVwlv+eKXkVXT92otcfh6xmX2Nv0pJmXP\nR0P+SZ9k7SH8al+/TVtd4GB4QrR+xRbOygdvxslIFnV8N8XCiBtwjo3RTJ/J\n5GU/PTUqtldKSY9z5+QTbTprvse+fX642abncvZ0L06/2xU3ZtTKXVbg0UXX\n3onBUqZImycJ3zd56JonsrOVZ8tuKKIl1nnHFMEQVWxsyD4ZHXcVMNEsesjP\n4hJgKjj/1MRswvN6pC8AM1cJLUCWkwHP5xIywt2op/WquPsbYqplBCVsRKFd\nrlhW\r\n=1Ik4\r\n-----END PGP SIGNATURE-----\r\n"},"main":"index.cjs.js","name":"@graphql-toolkit/graphql-tag-pluck","module":"index.esm.js","readme":"## GraphQL Tag Pluck\n\n`@graphql-toolkit/graphql-tag-pluck` will take JavaScript code as an input and will pluck all template literals provided to `graphql-tag`.\n\n**Input:**\n\n```js\nimport gql from 'graphql-tag';\n\nconst fragment = gql`\n  fragment Foo on FooType {\n    id\n  }\n`;\n\nconst doc = gql`\n  query foo {\n    foo {\n      ...Foo\n    }\n  }\n\n  ${fragment}\n`;\n```\n\n**Output:**\n\n```graphql\nfragment Foo on FooType {\n  id\n}\n\nquery foo {\n  foo {\n    ...Foo\n  }\n}\n```\n\nOriginally created because of https://graphql-code-generator.com/.\n\n### Usage\n\n`@graphql-toolkit/graphql-tag-pluck` is installable via NPM (or Yarn):\n\n    $ npm install @graphql-toolkit/graphql-tag-pluck\n\nOnce installed you can pluck GraphQL template literals using one of the following methods:\n\n```js\nimport gqlPluck, { gqlPluckFromFile, gqlPluckFromCodeString } from '@graphql-toolkit/graphql-tag-pluck';\n\n// Returns promise\ngqlPluck.fromFile(filePath, {\n  useSync: true, // Optional, will return string if so\n});\n\n// Returns string\ngqlPluck.fromFile.sync(filePath);\n\n// Returns string\ngqlPluck.fromCodeString(codeString, {\n  fileExt: '.ts', // Optional, defaults to '.js'\n});\n```\n\nTemplate literals leaded by magic comments will also be extracted :-)\n\n```js\n/* GraphQL */ `\n  enum MessageTypes {\n    text\n    media\n    draftjs\n  }\n`;\n```\n\nsupported file extensions are: `.js`, `.jsx`, `.ts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.graphqls`, `.graphql`, `.gqls`, `.gql`.\n\n### Options\n\nI recommend you to look at the [source code](src/visitor.js) for a clearer understanding of the transformation options.\n\n- **`gqlMagicComment`**\n\n  The magic comment anchor to look for when parsing GraphQL strings. Defaults to `graphql`, which may be translated into `/* GraphQL */` in code.\n\n- **`globalGqlIdentifierName`**\n\n  Allows to use a global identifier instead of a module import.\n\n  ```js\n  // `graphql` is a global function\n  export const usersQuery = graphql`\n    {\n      users {\n        id\n        name\n      }\n    }\n  `;\n  ```\n\n- **`modules`**\n\n  An array of packages that are responsible for exporting the GraphQL string parser function. The following modules are supported by default:\n\n  ```js\n  {\n    modules: [\n      {\n        // import gql from 'graphql-tag'\n        name: 'graphql-tag',\n      },\n      {\n        name: 'graphql-tag.macro',\n      },\n      {\n        // import { graphql } from 'gatsby'\n        name: 'gatsby',\n        identifier: 'graphql',\n      },\n      {\n        name: 'apollo-server-express',\n        identifier: 'gql',\n      },\n      {\n        name: 'apollo-server',\n        identifier: 'gql',\n      },\n      {\n        name: 'react-relay',\n        identifier: 'graphql',\n      },\n      {\n        name: 'apollo-boost',\n        identifier: 'gql',\n      },\n      {\n        name: 'apollo-server-koa',\n        identifier: 'gql',\n      },\n      {\n        name: 'apollo-server-hapi',\n        identifier: 'gql',\n      },\n      {\n        name: 'apollo-server-fastify',\n        identifier: 'gql',\n      },\n      {\n        name: ' apollo-server-lambda',\n        identifier: 'gql',\n      },\n      {\n        name: 'apollo-server-micro',\n        identifier: 'gql',\n      },\n      {\n        name: 'apollo-server-azure-functions',\n        identifier: 'gql',\n      },\n      {\n        name: 'apollo-server-cloud-functions',\n        identifier: 'gql',\n      },\n      {\n        name: 'apollo-server-cloudflare',\n        identifier: 'gql',\n      },\n    ];\n  }\n  ```\n\n### License\n\nMIT\n","license":"MIT","typings":"index.d.ts","_npmUser":{"name":"ardatan","email":"ardatanrikulu@gmail.com"},"homepage":"https://github.com/ardatan/graphql-toolkit#readme","repository":{"url":"git+ssh://git@github.com/ardatan/graphql-toolkit.git","type":"git"},"typescript":{"definition":"index.d.ts"},"_npmVersion":"lerna/3.20.2/node@v13.12.0+x64 (linux)","description":"Pluck graphql-tag template literals","directories":{},"maintainers":[{"name":"ardatan","email":"ardatanrikulu@gmail.com"},{"name":"dotansimha","email":"dotansimha@gmail.com"},{"name":"urigo","email":"uri.goldshtein@gmail.com"}],"sideEffects":false,"_nodeVersion":"13.12.0","dependencies":{"@babel/types":"7.9.5","@babel/parser":"7.9.4","@babel/traverse":"7.9.5","vue-template-compiler":"^2.6.11","@graphql-toolkit/common":"0.10.4-alpha-e78d594.8+e78d594"},"_hasShrinkwrap":false,"readmeFilename":"README.md","peerDependencies":{"graphql":"^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0"},"optionalDependencies":{"vue-template-compiler":"^2.6.11"},"_npmOperationalInternal":{"tmp":"tmp/graphql-tag-pluck_0.10.4-alpha-e78d594.8_1586867925374_0.13158922607207635","host":"s3://npm-registry-packages"},"_id":"@graphql-toolkit/graphql-tag-pluck@0.10.4-alpha-e78d594.8","version":"0.10.4-alpha-e78d594.8"}