{"_id":"@ardatan/graphql-tools","_rev":"257251","name":"@ardatan/graphql-tools","description":"Useful tools to create and manipulate GraphQL schemas.","dist-tags":{"latest":"4.1.0"},"maintainers":[{"name":"ardatan","email":""}],"time":{"modified":"2021-06-03T16:28:56.000Z","created":"2020-01-11T14:59:20.994Z","4.1.0":"2020-01-12T02:53:16.024Z","4.0.9":"2020-01-11T17:05:03.289Z","4.0.8":"2020-01-11T16:40:40.998Z","4.0.7":"2020-01-11T14:59:20.994Z"},"users":{},"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-tools.git"},"versions":{"4.1.0":{"name":"@ardatan/graphql-tools","version":"4.1.0","description":"Useful tools to create and manipulate GraphQL schemas.","main":"dist/index.js","typings":"dist/index.d.ts","typescript":{"definition":"dist/index.d.ts"},"directories":{"test":"test"},"scripts":{"clean":"rimraf dist","compile":"npx tsc","typings":"typings install","pretest":"npm run clean && npm run compile","test":"npm run testonly --","posttest":"npm run lint","lint":"tslint src/**/*.ts","watch":"tsc -w","testonly":"mocha --reporter spec --full-trace ./dist/test/tests.js","testonly:watch":"mocha -w --reporter spec --full-trace ./dist/test/tests.js","coverage":"istanbul cover _mocha -- --reporter dot --full-trace ./dist/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","prepublishOnly":"npm run compile","prerelease":"npm test","prettier":"prettier --trailing-comma all --single-quote --write 'src/**/*.ts'","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-tools.git"},"keywords":["GraphQL","Apollo","JavaScript","TypeScript","Mock","Schema","Schema Language","Tools"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","bugs":{"url":"https://github.com/apollostack/graphql-tools/issues"},"homepage":"https://github.com/apollostack/graphql-tools#readme","dependencies":{"apollo-link":"^1.2.3","apollo-utilities":"^1.0.1","deprecated-decorator":"^0.1.6","iterall":"^1.1.3","uuid":"^3.1.0"},"peerDependencies":{"graphql":"^0.13.0 || ^14.0.0"},"devDependencies":{"@types/chai":"4.0.10","@types/dateformat":"^1.0.1","@types/mocha":"^2.2.44","@types/node":"^8.0.47","@types/uuid":"^3.4.3","@types/zen-observable":"^0.5.3","body-parser":"^1.18.2","chai":"^4.1.2","dateformat":"^3.0.3","express":"^4.16.2","graphql":"^14.5.8","graphql-subscriptions":"^1.0.0","graphql-type-json":"^0.1.4","istanbul":"^0.4.5","mocha":"^4.0.1","prettier":"^1.7.4","remap-istanbul":"0.9.6","rimraf":"^2.6.2","source-map-support":"^0.5.0","tslint":"^5.8.0","typescript":"^3.6.4"},"publishConfig":{"access":"public"},"gitHead":"e1da8629ab6daf5860cbae92c99e167ca442acb2","_id":"@ardatan/graphql-tools@4.1.0","_nodeVersion":"13.1.0","_npmVersion":"6.12.1","dist":{"shasum":"183508ef4e3d4966f763cb1634a81be1c1255f8d","size":99276,"noattachment":false,"key":"/@ardatan/graphql-tools/-/@ardatan/graphql-tools-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/@ardatan/graphql-tools/download/@ardatan/graphql-tools-4.1.0.tgz"},"maintainers":[{"name":"ardatan","email":""}],"_npmUser":{"name":"ardatan","email":"ardatanrikulu@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-tools_4.1.0_1578797595864_0.06109354985421511"},"_hasShrinkwrap":false,"publish_time":1578797596024,"_cnpm_publish_time":1578797596024},"4.0.9":{"name":"@ardatan/graphql-tools","version":"4.0.9","description":"Useful tools to create and manipulate GraphQL schemas.","main":"dist/index.js","typings":"dist/index.d.ts","typescript":{"definition":"dist/index.d.ts"},"directories":{"test":"test"},"scripts":{"clean":"rimraf dist","compile":"npx tsc","typings":"typings install","pretest":"npm run clean && npm run compile","test":"npm run testonly --","posttest":"npm run lint","lint":"tslint src/**/*.ts","watch":"tsc -w","testonly":"mocha --reporter spec --full-trace ./dist/test/tests.js","testonly:watch":"mocha -w --reporter spec --full-trace ./dist/test/tests.js","coverage":"istanbul cover _mocha -- --reporter dot --full-trace ./dist/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","prepublishOnly":"npm run compile","prerelease":"npm test","prettier":"prettier --trailing-comma all --single-quote --write 'src/**/*.ts'","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-tools.git"},"keywords":["GraphQL","Apollo","JavaScript","TypeScript","Mock","Schema","Schema Language","Tools"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","bugs":{"url":"https://github.com/apollostack/graphql-tools/issues"},"homepage":"https://github.com/apollostack/graphql-tools#readme","dependencies":{"apollo-link":"^1.2.3","apollo-utilities":"^1.0.1","deprecated-decorator":"^0.1.6","iterall":"^1.1.3","uuid":"^3.1.0"},"peerDependencies":{"graphql":"^0.13.0 || ^14.0.0"},"devDependencies":{"@types/chai":"4.0.10","@types/dateformat":"^1.0.1","@types/mocha":"^2.2.44","@types/node":"^8.0.47","@types/uuid":"^3.4.3","@types/zen-observable":"^0.5.3","body-parser":"^1.18.2","chai":"^4.1.2","dateformat":"^3.0.3","express":"^4.16.2","graphql":"^14.5.8","graphql-subscriptions":"^1.0.0","graphql-type-json":"^0.1.4","istanbul":"^0.4.5","mocha":"^4.0.1","prettier":"^1.7.4","remap-istanbul":"0.9.6","rimraf":"^2.6.2","source-map-support":"^0.5.0","tslint":"^5.8.0","typescript":"^3.6.4"},"publishConfig":{"access":"public"},"gitHead":"e1da8629ab6daf5860cbae92c99e167ca442acb2","_id":"@ardatan/graphql-tools@4.0.9","_nodeVersion":"13.1.0","_npmVersion":"6.12.1","dist":{"shasum":"d3d15f69ce3e666c25f1c96b9461b19a248fda8a","size":99239,"noattachment":false,"key":"/@ardatan/graphql-tools/-/@ardatan/graphql-tools-4.0.9.tgz","tarball":"http://registry.cnpm.dingdandao.com/@ardatan/graphql-tools/download/@ardatan/graphql-tools-4.0.9.tgz"},"maintainers":[{"name":"ardatan","email":""}],"_npmUser":{"name":"ardatan","email":"ardatanrikulu@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-tools_4.0.9_1578762303123_0.3820640925847054"},"_hasShrinkwrap":false,"publish_time":1578762303289,"_cnpm_publish_time":1578762303289},"4.0.8":{"name":"@ardatan/graphql-tools","version":"4.0.8","description":"Useful tools to create and manipulate GraphQL schemas.","main":"dist/index.js","typings":"dist/index.d.ts","typescript":{"definition":"dist/index.d.ts"},"directories":{"test":"test"},"scripts":{"clean":"rimraf dist","compile":"npx tsc","typings":"typings install","pretest":"npm run clean && npm run compile","test":"npm run testonly --","posttest":"npm run lint","lint":"tslint src/**/*.ts","watch":"tsc -w","testonly":"mocha --reporter spec --full-trace ./dist/test/tests.js","testonly:watch":"mocha -w --reporter spec --full-trace ./dist/test/tests.js","coverage":"istanbul cover _mocha -- --reporter dot --full-trace ./dist/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","prepublishOnly":"npm run compile","prerelease":"npm test","prettier":"prettier --trailing-comma all --single-quote --write 'src/**/*.ts'","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-tools.git"},"keywords":["GraphQL","Apollo","JavaScript","TypeScript","Mock","Schema","Schema Language","Tools"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","bugs":{"url":"https://github.com/apollostack/graphql-tools/issues"},"homepage":"https://github.com/apollostack/graphql-tools#readme","dependencies":{"apollo-link":"^1.2.3","apollo-utilities":"^1.0.1","deprecated-decorator":"^0.1.6","iterall":"^1.1.3","uuid":"^3.1.0"},"peerDependencies":{"graphql":"^0.13.0 || ^14.0.0"},"devDependencies":{"@types/chai":"4.0.10","@types/dateformat":"^1.0.1","@types/mocha":"^2.2.44","@types/node":"^8.0.47","@types/uuid":"^3.4.3","@types/zen-observable":"^0.5.3","body-parser":"^1.18.2","chai":"^4.1.2","dateformat":"^3.0.3","express":"^4.16.2","graphql":"^14.5.8","graphql-subscriptions":"^1.0.0","graphql-type-json":"^0.1.4","istanbul":"^0.4.5","mocha":"^4.0.1","prettier":"^1.7.4","remap-istanbul":"0.9.6","rimraf":"^2.6.2","source-map-support":"^0.5.0","tslint":"^5.8.0","typescript":"^3.6.4"},"publishConfig":{"access":"public"},"gitHead":"e1da8629ab6daf5860cbae92c99e167ca442acb2","_id":"@ardatan/graphql-tools@4.0.8","_nodeVersion":"13.1.0","_npmVersion":"6.12.1","dist":{"shasum":"099f8ebd673fff907d0c49510ddd80a06ac0f6ac","size":99171,"noattachment":false,"key":"/@ardatan/graphql-tools/-/@ardatan/graphql-tools-4.0.8.tgz","tarball":"http://registry.cnpm.dingdandao.com/@ardatan/graphql-tools/download/@ardatan/graphql-tools-4.0.8.tgz"},"maintainers":[{"name":"ardatan","email":""}],"_npmUser":{"name":"ardatan","email":"ardatanrikulu@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-tools_4.0.8_1578760840886_0.3069998588084959"},"_hasShrinkwrap":false,"publish_time":1578760840998,"_cnpm_publish_time":1578760840998},"4.0.7":{"name":"@ardatan/graphql-tools","version":"4.0.7","description":"Useful tools to create and manipulate GraphQL schemas.","main":"dist/index.js","typings":"dist/index.d.ts","typescript":{"definition":"dist/index.d.ts"},"directories":{"test":"test"},"scripts":{"clean":"rimraf dist","compile":"npx tsc","typings":"typings install","pretest":"npm run clean && npm run compile","test":"npm run testonly --","posttest":"npm run lint","lint":"tslint src/**/*.ts","watch":"tsc -w","testonly":"mocha --reporter spec --full-trace ./dist/test/tests.js","testonly:watch":"mocha -w --reporter spec --full-trace ./dist/test/tests.js","coverage":"istanbul cover _mocha -- --reporter dot --full-trace ./dist/test/tests.js","postcoverage":"remap-istanbul --input coverage/coverage.json --type lcovonly --output coverage/lcov.info","prepublishOnly":"npm run compile","prerelease":"npm test","prettier":"prettier --trailing-comma all --single-quote --write 'src/**/*.ts'","release":"standard-version"},"repository":{"type":"git","url":"git+https://github.com/apollographql/graphql-tools.git"},"keywords":["GraphQL","Apollo","JavaScript","TypeScript","Mock","Schema","Schema Language","Tools"],"author":{"name":"Jonas Helfer","email":"jonas@helfer.email"},"license":"MIT","bugs":{"url":"https://github.com/apollostack/graphql-tools/issues"},"homepage":"https://github.com/apollostack/graphql-tools#readme","dependencies":{"apollo-link":"^1.2.3","apollo-utilities":"^1.0.1","deprecated-decorator":"^0.1.6","iterall":"^1.1.3","uuid":"^3.1.0"},"peerDependencies":{"graphql":"^0.13.0 || ^14.0.0"},"devDependencies":{"@types/chai":"4.0.10","@types/dateformat":"^1.0.1","@types/mocha":"^2.2.44","@types/node":"^8.0.47","@types/uuid":"^3.4.3","@types/zen-observable":"^0.5.3","body-parser":"^1.18.2","chai":"^4.1.2","dateformat":"^3.0.3","express":"^4.16.2","graphql":"^14.5.8","graphql-subscriptions":"^1.0.0","graphql-type-json":"^0.1.4","istanbul":"^0.4.5","mocha":"^4.0.1","prettier":"^1.7.4","remap-istanbul":"0.9.6","rimraf":"^2.6.2","source-map-support":"^0.5.0","tslint":"^5.8.0","typescript":"^3.6.4"},"publishConfig":{"access":"public"},"gitHead":"e1da8629ab6daf5860cbae92c99e167ca442acb2","_id":"@ardatan/graphql-tools@4.0.7","_nodeVersion":"13.1.0","_npmVersion":"6.12.1","dist":{"shasum":"8576d558c823eef5cd7c2a22ecf90642b7537336","size":99145,"noattachment":false,"key":"/@ardatan/graphql-tools/-/@ardatan/graphql-tools-4.0.7.tgz","tarball":"http://registry.cnpm.dingdandao.com/@ardatan/graphql-tools/download/@ardatan/graphql-tools-4.0.7.tgz"},"maintainers":[{"name":"ardatan","email":""}],"_npmUser":{"name":"ardatan","email":"ardatanrikulu@gmail.com"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/graphql-tools_4.0.7_1578754760777_0.5514055523613839"},"_hasShrinkwrap":false,"publish_time":1578754760994,"_cnpm_publish_time":1578754760994}},"readme":"# GraphQL-tools: generate and mock GraphQL.js schemas\n\n[![npm version](https://badge.fury.io/js/graphql-tools.svg)](https://badge.fury.io/js/graphql-tools)\n[![Build Status](https://travis-ci.org/apollographql/graphql-tools.svg?branch=master)](https://travis-ci.org/apollographql/graphql-tools)\n[![Coverage Status](https://coveralls.io/repos/github/apollographql/graphql-tools/badge.svg?branch=master)](https://coveralls.io/github/apollographql/graphql-tools?branch=master)\n[![Get on Slack](https://img.shields.io/badge/slack-join-orange.svg)](http://www.apollostack.com/#slack)\n\nThis package provides a few useful ways to create a GraphQL schema:\n\n1. Use the GraphQL schema language to [generate a schema](https://www.apollographql.com/docs/graphql-tools/generate-schema.html) with full support for resolvers, interfaces, unions, and custom scalars. The schema produced is completely compatible with [GraphQL.js](https://github.com/graphql/graphql-js).\n2. [Mock your GraphQL API](https://www.apollographql.com/docs/graphql-tools/mocking.html) with fine-grained per-type mocking\n3. Automatically [stitch multiple schemas together](https://www.apollographql.com/docs/graphql-tools/schema-stitching.html) into one larger API\n\n## Documentation\n\n[Read the docs.](https://www.apollographql.com/docs/graphql-tools/)\n\n## Binding to HTTP\n\nIf you want to bind your JavaScript GraphQL schema to an HTTP server, we recommend using [Apollo Server](https://github.com/apollographql/apollo-server/), which supports every popular Node HTTP server library including Express, Koa, Hapi, and more.\n\nJavaScript GraphQL servers are often developed with `graphql-tools` and `apollo-server-express` together: One to write the schema and resolver code, and the other to connect it to a web server.\n\n## Example\n\nWhen using `graphql-tools`, you describe the schema as a GraphQL type language string:\n\n```js\n\nconst typeDefs = `\ntype Author {\n  id: ID! # the ! means that every author object _must_ have an id\n  firstName: String\n  lastName: String\n  \"\"\"\n  the list of Posts by this author\n  \"\"\"\n  posts: [Post]\n}\n\ntype Post {\n  id: ID!\n  title: String\n  author: Author\n  votes: Int\n}\n\n# the schema allows the following query:\ntype Query {\n  posts: [Post]\n}\n\n# this schema allows the following mutation:\ntype Mutation {\n  upvotePost (\n    postId: ID!\n  ): Post\n}\n\n# we need to tell the server which types represent the root query\n# and root mutation types. We call them RootQuery and RootMutation by convention.\nschema {\n  query: Query\n  mutation: Mutation\n}\n`;\n\nexport default typeDefs;\n```\n\nThen you define resolvers as a nested object that maps type and field names to resolver functions:\n\n```js\nconst resolvers = {\n  Query: {\n    posts() {\n      return posts;\n    },\n  },\n  Mutation: {\n    upvotePost(_, { postId }) {\n      const post = find(posts, { id: postId });\n      if (!post) {\n        throw new Error(`Couldn't find post with id ${postId}`);\n      }\n      post.votes += 1;\n      return post;\n    },\n  },\n  Author: {\n    posts(author) {\n      return filter(posts, { authorId: author.id });\n    },\n  },\n  Post: {\n    author(post) {\n      return find(authors, { id: post.authorId });\n    },\n  },\n};\n\nexport default resolvers;\n```\n\nAt the end, the schema and resolvers are combined using `makeExecutableSchema`:\n\n```js\nimport { makeExecutableSchema } from 'graphql-tools';\n\nconst executableSchema = makeExecutableSchema({\n  typeDefs,\n  resolvers,\n});\n```\n\nThis example has the entire type definition in one string and all resolvers in one file, but you can combine types and resolvers from multiple files and objects, as documented in the [modularizing the schema](https://www.apollographql.com/docs/graphql-tools/generate-schema.html#modularizing) section of the docs.\n\n## Contributions\n\nContributions, issues and feature requests are very welcome. If you are using this package and fixed a bug for yourself, please consider submitting a PR!\n\n## Maintainers\n\n- [@hwillson](https://github.com/hwillson) (Apollo)\n- [@benjamn](https://github.com/benjamn) (Apollo)\n","_attachments":{},"homepage":"https://github.com/apollostack/graphql-tools#readme","bugs":{"url":"https://github.com/apollostack/graphql-tools/issues"},"license":"MIT"}