{"name":"graphql-import","version":"1.0.0-3d5f2bb.0","license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/ardatan/graphql-import.git"},"sideEffects":false,"main":"dist/index.cjs.js","module":"dist/index.esm.js","typings":"dist/index.d.ts","typescript":{"definition":"dist/index.d.ts"},"buildOptions":{"input":"./src/index.ts"},"scripts":{"clean":"rimraf dist","prebuild":"yarn clean","build":"bob","prepack":"bob-update-version","test":"jest --no-watchman --passWithNoTests","ci:release:canary":"node bump.js && npm publish --tag alpha","docs":"typedoc --out docs src/index.ts --hideGenerator --exclude **/*.test.ts","docs:publish":"cp ./now.json ./docs && cd docs && now --public -f && now alias && now rm --yes --safe graphql-import & cd .."},"peerDependencies":{"graphql":"^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0"},"devDependencies":{"@ardatan/bob":"0.2.7","@types/jest":"25.1.0","jest":"25.1.0","ts-jest":"25.0.0","@types/lodash":"4.14.149","@types/node":"13.5.1","graphql":"14.6.0","tslint":"5.20.1","tslint-config-standard":"9.0.0","typedoc":"0.16.9","typescript":"3.7.5"},"dependencies":{"@graphql-toolkit/apollo-engine-loader":"0.9.7","@graphql-toolkit/core":"0.9.7","@graphql-toolkit/code-file-loader":"0.9.7","@graphql-toolkit/url-loader":"0.9.6","@graphql-toolkit/json-file-loader":"0.9.7","@graphql-toolkit/graphql-file-loader":"0.9.7","@graphql-toolkit/git-loader":"0.9.7","@graphql-toolkit/github-loader":"0.9.7","@graphql-toolkit/prisma-loader":"0.9.7"},"gitHead":"3d5f2bb2394181edec9cd0c753742cfd25c50ead","readme":"# graphql-import\n\n[![Discord Chat](https://img.shields.io/discord/625400653321076807)](https://discord.gg/xud7bH9)\n\n## Install\n\n```sh\nyarn add graphql-import@beta\n```\n\n## Usage\n\n```ts\nimport { importSchema } from 'graphql-import'\nimport { makeExecutableSchema } from 'graphql-tools'\n\nasync function start() {\n  const typeDefs = await importSchema('schema.graphql'); // or .gql or glob pattern like **/*.graphql\n  const resolvers = {};\n\n  const schema = makeExecutableSchema({ typeDefs, resolvers })\n}\n\nmain().catch(err => console.error(err));\n```\n\nAssume the following directory structure:\n\n```\n.\n├── schema.graphql\n├── posts.graphql\n└── comments.graphql\n```\n\n`schema.graphql`\n\n```graphql\n# import Post from \"posts.graphql\"\n\ntype Query {\n  posts: [Post]\n}\n```\n\n`posts.graphql`\n\n```graphql\n# import Comment from 'comments.graphql'\n\ntype Post {\n  comments: [Comment]\n  id: ID!\n  text: String!\n  tags: [String]\n}\n```\n\n`comments.graphql`\n\n```graphql\ntype Comment {\n  id: ID!\n  text: String!\n}\n```\n\nRunning `importSchema('schema.graphql')` produces the following output:\n\n```graphql\ntype Query {\n  posts: [Post]\n}\n\ntype Post {\n  comments: [Comment]\n  id: ID!\n  text: String!\n  tags: [String]\n}\n\ntype Comment {\n  id: ID!\n  text: String!\n}\n```\n\n\n## Updating from 0.7.x\nInstall the new version as in `Install` step and after that update your code as in `Usage` step because `importSchema` is not sync anymore and returns promise,. We recommend you to use `async/await` to make the migration simple.\nThe second parameter is now `options`. \nIf you want to provide preresolved type definitions as in `0.7.x`, use the method below;\nBefore\n\n```ts\nconst finalSchema = importSchema('somePointer', {\n  'mySchema': `\n      type Query {\n        foo: String\n      }\n    `\n})\n```\n\nAfter\n```ts\nconst finalSchema = await importSchema('somePointer', {\n  cache: {\n    'mySchema': {\n      rawSDL: `\n        type Query {\n          foo: String\n        }\n      `\n    }\n  }\n})\n```","readmeFilename":"README.md","description":"[![Discord Chat](https://img.shields.io/discord/625400653321076807)](https://discord.gg/xud7bH9)","bugs":{"url":"https://github.com/ardatan/graphql-import/issues"},"homepage":"https://github.com/ardatan/graphql-import#readme","_id":"graphql-import@1.0.0-3d5f2bb.0","_nodeVersion":"13.7.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-SjfRZbLDQxrkfPlIfojzyRT2lhiFQKP9fsLwDJ7AtCrToqZX+ggS0n+ks1uUojB3i3dE9DQ2E1lLhiRtKvceMg==","shasum":"65ad97cb5ab7004d447e01c38ccedf2a1e2a78f1","tarball":"http://registry-npm.ywwl.com/graphql-import/download/graphql-import-1.0.0-3d5f2bb.0.tgz","fileCount":13,"unpackedSize":14020,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeMQ68CRA9TVsSAnZWagAAM5AP/RmxeJKxczE5iPwm7UnA\n9FtRdejcxHSS5Ej88ErJpM4dLsyi0j6ikyEGNfJhdAje9g8+jqm/VXB1bYJc\nackDd6aQYxVX4tHdy/Uw5vY8bGcvzbBrhrNIm6CLLeFxK5zcH0CQNoFAZ6Ny\nONxhOEEMKXeKH4m7pEKU1HOlNv84NwvFIZ+DoFfVZNdPr+gFcl/42F0epL4u\n10MXNUcgX/gGNUbWLW+BkMvW7G8EIsJPrkRyCa4msUs2eYtJa2ZQ0ASqb+L2\n4KdZ344FsSkQfDDLQBkd5eOub3xts8xQW942yoz+16Qg8XnsqaHDSrzE9Eko\n1JPtY4TU3+Y5OM0ZxBXVUwg+JGC+Lqfd2SgJn4iPtLWLbcrxrIRq5px47zQk\nW9owR3oT9txLzmhzBLRchoTBUurycRrheC6ZDzn5pWj1MZybi1POHai2MHZa\nhS4KEug2h0RriGaHTGN9oYYSHEo0/jr6cxggMTJfgK9ymUmvBN03OnHhu86J\ndJ1APrLUnDL0T7TjArJspGOIEgbU/fXW7wWRFN62RXUCEXIRyuiwV5AyEFx2\n5FCQZszIzLDfGmC+WdIe2cQ00uNaAk5QsT/bhCG830bQwhghXy6lvetmQFeP\nWZTAH0tNOwtNA/A8yHFsocr0zuLAexYg9uZ7i3eEfPU42RNAr9TbIvPZbC4B\nbhrd\r\n=f5yC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBPFsDWyR+HPCsvM0FyxLFtlHlvYuq4+5teUlIWiWRBJAiAaSypBJU9kNg2eirTNfjw4P2fYhjSz4qAkuN7DEIyewg=="}],"size":4817,"noattachment":false,"key":"/graphql-import/-/graphql-import-1.0.0-3d5f2bb.0.tgz"},"maintainers":[{"email":"ardatanrikulu@gmail.com","name":"ardatan"},{"email":"dotansimha@gmail.com","name":"dotansimha"},{"email":"kamil.kisiela@gmail.com","name":"kamilkisiela"},{"email":"kim.brandwijk@gmail.com","name":"kbrandwijk"},{"email":"schickling.j@gmail.com","name":"schickling"},{"email":"tim.suchanek@gmail.com","name":"timsuchanek"},{"email":"uri.goldshtein@gmail.com","name":"urigo"}],"_npmUser":{"name":"ardatan","email":"ardatanrikulu@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-import_1.0.0-3d5f2bb.0_1580273340174_0.4623827721299585"},"_hasShrinkwrap":false,"publish_time":1580273340485,"_cnpm_publish_time":1580273340485,"dist-tags":{"alpha":"1.0.3-8028e86.0","beta":"1.0.0-beta.1","latest":"1.0.2"}}