{"_id":"@ambler/prisma-binding","_rev":"3-b73485a3f8dd762aa224731c9748efaf","name":"@ambler/prisma-binding","dist-tags":{"latest":"2.1.0-ambler.2"},"versions":{"2.1.0-ambler.0":{"name":"@ambler/prisma-binding","version":"2.1.0-ambler.0","main":"dist/index.js","typings":"./dist/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com:amblerhq/prisma-binding.git"},"author":{"name":"Johannes Schickling","email":"johannes@graph.cool"},"contributors":[{"name":"Kim Brandwijk","email":"kim.brandwijk@gmail.com"},{"name":"Tim Suchanek","email":"suchanek@prisma.io"}],"bin":{"prisma-binding":"dist/bin.js"},"license":"MIT","bugs":{"url":"https://github.com/amblerhq/prisma-binding/issues"},"homepage":"https://github.com/amblerhq/prisma-binding","scripts":{"prepublish":"npm run build","build":"rm -rf dist && tsc -d","lint":"tslint --type-check --project tsconfig.json {src,test}/**/*.ts","test":"npm run lint && npm run build && copyfiles -u 2 tests/fixtures/* dist/tests/fixtures && ava"},"dependencies":{"apollo-link":"1.2.2","apollo-link-error":"1.0.9","apollo-link-ws":"1.0.8","cross-fetch":"2.1.1","graphql-binding":"2.1.1","graphql-import":"0.5.2","graphql-tools":"3.0.1","http-link-dataloader":"^0.1.2","jsonwebtoken":"8.2.1","subscriptions-transport-ws":"0.9.8"},"devDependencies":{"@types/graphql":"0.13.0","@types/jsonwebtoken":"7.2.7","@types/node":"10.0.3","ava":"0.25.0","copyfiles":"2.0.0","graphql":"0.13.2","semantic-release":"^15.5.2","tslint":"5.9.1","tslint-config-standard":"7.0.0","typescript":"2.8.3"},"peerDependencies":{"graphql":"^0.11.0 || ^0.12.0 || ^0.13.0"},"release":{"branch":"jdn/add-externalLink"},"description":"[![CircleCI](https://circleci.com/gh/prismagraphql/prisma-binding.svg?style=shield)](https://circleci.com/gh/prismagraphql/prisma-binding) [![npm version](https://badge.fury.io/js/prisma-binding.svg)](https://badge.fury.io/js/prisma-binding)","_id":"@ambler/prisma-binding@2.1.0-ambler.0","dist":{"shasum":"38c4fb771c4268985443be538842624424586ab1","integrity":"sha512-WAQGh4Agwijo1H038jRqFRyK3EMIYvLDXc8+IUuIlF97RUbEQdYo+DR9IxzUh8bLyEMZtPUH48Dw/+kjhBOjHQ==","tarball":"https://registry.npmjs.org/@ambler/prisma-binding/-/prisma-binding-2.1.0-ambler.0.tgz","fileCount":55,"unpackedSize":65022,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID31uoqVMvoF+y8A9DCx1ExO4x4AJPyMXKtgKirWhmZBAiEAnLgCevaYfFaDSJZO2mBQIGdt9J/cXqBLAgqtSZTBj1k="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZBNSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrHiA//Y1yPmOmWfQ948NQLJslcojcCpY8qaxFSV7MpKt9s9OH3lhMY\r\ni/MMiKe3TXFMd/N+JH3yhLRnRvYlDOzIF0qYTx1uK64r98biOFVB81cykUeW\r\nkOj/zQAp3auCFPhczuyDM7IT7lkudkSXoYoDwMzeHQno1u4a0fIXV2BSbFxz\r\n3MVWez7uZYLWIqvgFAXaqcNx6nw7P0eLZ+Uc4e77qDAkkb/KHLxe0FQCJdfn\r\nVjkDm8FgCWRzBHAACa4QOE7IRj7LIXFIvbrRzru5r6bB8KPKy1dK5lKnKbD0\r\nPb+pXoN1faSgmfpdNKTgsQdr5N/BwT+WvLTw52wmdWTzXk94vCSVwPTBlbVo\r\n85OVT3iULa9fY9JgrxGSqWlDhle97REj0POpTohz/rlmgDNYHk9kRe+7YzAZ\r\nz9mpCYSuxvQWIS5ho1WBKWaM2rsv1s5ilK2/ohZyTwHXkWOVcMw/FkwK7ao4\r\nhwXefb5QUm0s1OVhISZxHeNNKqzhXGnzsY6L4VBhph9ENIDdGXjCWqnL4Qr/\r\nBvmmU2pGZptbH4n6DpaH59CYszk3LH9JaK/mc3kp8fw2gQAAFQF9/J9ZR80d\r\nPmL0Z/Kt2unRxPrB9X10eQiTdZsD8za4MX4eGzC+bxU4VvH1hflSaytrDYrS\r\nFZMLG3wRLx4wyOpy8H7Zhldc9daZKB5aGZA=\r\n=Jylg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"chabou","email":"chabup@delean.fr"},"directories":{},"maintainers":[{"name":"chabou","email":"chabup@delean.fr"},{"name":"nbarray","email":"nbarray@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prisma-binding_2.1.0-ambler.0_1650725714457_0.3682124558575828"},"_hasShrinkwrap":false},"2.1.0-ambler.1":{"name":"@ambler/prisma-binding","version":"2.1.0-ambler.1","main":"dist/index.js","typings":"./dist/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com:amblerhq/prisma-binding.git"},"author":{"name":"Johannes Schickling","email":"johannes@graph.cool"},"contributors":[{"name":"Kim Brandwijk","email":"kim.brandwijk@gmail.com"},{"name":"Tim Suchanek","email":"suchanek@prisma.io"}],"bin":{"prisma-binding":"dist/bin.js"},"license":"MIT","bugs":{"url":"https://github.com/amblerhq/prisma-binding/issues"},"homepage":"https://github.com/amblerhq/prisma-binding","scripts":{"prepublish":"npm run build","build":"rm -rf dist && tsc -d","lint":"tslint --type-check --project tsconfig.json {src,test}/**/*.ts","test":"npm run lint && npm run build && copyfiles -u 2 tests/fixtures/* dist/tests/fixtures && ava"},"dependencies":{"apollo-link":"1.2.2","apollo-link-error":"1.0.9","apollo-link-ws":"1.0.8","cross-fetch":"2.1.1","graphql-binding":"2.1.1","graphql-import":"0.5.2","graphql-tools":"3.0.1","http-link-dataloader":"^0.1.2","jsonwebtoken":"8.2.1","subscriptions-transport-ws":"0.9.8"},"devDependencies":{"@types/graphql":"0.13.0","@types/jsonwebtoken":"7.2.7","@types/node":"10.0.3","ava":"0.25.0","copyfiles":"2.0.0","graphql":"0.13.2","semantic-release":"^15.5.2","tslint":"5.9.1","tslint-config-standard":"7.0.0","typescript":"2.8.3"},"peerDependencies":{"graphql":"^0.11.0 || ^0.12.0 || ^0.13.0"},"release":{"branch":"jdn/add-externalLink"},"description":"[![CircleCI](https://circleci.com/gh/prismagraphql/prisma-binding.svg?style=shield)](https://circleci.com/gh/prismagraphql/prisma-binding) [![npm version](https://badge.fury.io/js/prisma-binding.svg)](https://badge.fury.io/js/prisma-binding)","_id":"@ambler/prisma-binding@2.1.0-ambler.1","dist":{"shasum":"1651a0c0bf8f5e9c54a47db57e7a0dde9fea4ed1","integrity":"sha512-uSyZXLtmVMzAkNBcTcgF0FIVwCjPyYemTK2i2ODLyH1yqzKgr3O4Aysr2sB+g0Wg9hw235HA9L02yBLhrVcaeg==","tarball":"https://registry.npmjs.org/@ambler/prisma-binding/-/prisma-binding-2.1.0-ambler.1.tgz","fileCount":55,"unpackedSize":65394,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDqLgsZaPIZgojYNAs54jLOuJkTwohIsBDNBh46n/mVLwIhAJ6k8oAiji0HOdXBAG17YI3KonK8f9eab8cdNQ7dGt0r"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZZ0tACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq7Og/8CAWckGwPNYwL1HHhA6a+YsOQqqgmxg1gzzFboHAH4epzHI7r\r\nJEZfEIkX1Gzno6nuit4joFJXcIh8NJiZFPtT+kbzuWUwJKncv8SmMwrBu8fu\r\nA+a6xJQpOvd4zJmrV0kWUkKgst0PV6Z1IF6GZsaoZ8PrlNvTdEukPCtvburE\r\nzoVWMvuqHYJhVr8Avdp+PTQL7+QTD88LDjR5F63QCUIJ/Sm8jrz9HcQMWxdJ\r\nzUGPNRw8Vft20Rc7Ps3TWWzuC9/tpGOQlhuUdnQvPVIcrW5fUSnZtSmm0IgA\r\ndCLpVKkB0nDt/QR3jJd/G11fp4AT03rEmTfhG5svXvRJ3TK9jxuVNxrQQpKQ\r\n88PDQW8JvPN6GKTTTFicmKSokdhJH40yCyTjIJWwXjDmGUHIXdTkfzT8SH/l\r\nRcy75mWaC7r6iYhTchrUiLsOGRoV0WXcT8rNr7oZ8HKxnkS/1snR3Laq83L7\r\nflh1EF+XevnEUcLkhWUnYXqm99+qRXrQ6rjFCxoH6+7dwiy0kEXuuVlXDQYr\r\n/d2Nf2sdwJAO0Yh6siU7phJ51aVcnLVy9qC6wW4kQoycsk70z1YEIRaWvv2v\r\nmg4YhBmx/S7wGMsP9kwGaWgONCdlwsw/yna1AAyNw8P74rHgnc10Ho2ruwBb\r\nzAbPx1L3dG3Zw2qyWp4umIOXAo6QHn8jviU=\r\n=slNY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"chabou","email":"chabup@delean.fr"},"directories":{},"maintainers":[{"name":"chabou","email":"chabup@delean.fr"},{"name":"nbarray","email":"nbarray@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prisma-binding_2.1.0-ambler.1_1650826540847_0.7536926591744202"},"_hasShrinkwrap":false},"2.1.0-ambler.2":{"name":"@ambler/prisma-binding","version":"2.1.0-ambler.2","main":"dist/index.js","typings":"./dist/index.d.ts","repository":{"type":"git","url":"git+ssh://git@github.com:amblerhq/prisma-binding.git"},"author":{"name":"Johannes Schickling","email":"johannes@graph.cool"},"contributors":[{"name":"Kim Brandwijk","email":"kim.brandwijk@gmail.com"},{"name":"Tim Suchanek","email":"suchanek@prisma.io"}],"bin":{"prisma-binding":"dist/bin.js"},"license":"MIT","bugs":{"url":"https://github.com/amblerhq/prisma-binding/issues"},"homepage":"https://github.com/amblerhq/prisma-binding","scripts":{"prepublish":"npm run build","build":"rm -rf dist && tsc -d","lint":"tslint --type-check --project tsconfig.json {src,test}/**/*.ts","test":"npm run lint && npm run build && copyfiles -u 2 tests/fixtures/* dist/tests/fixtures && ava"},"dependencies":{"apollo-link":"1.2.2","apollo-link-error":"1.0.9","apollo-link-ws":"1.0.8","cross-fetch":"2.1.1","graphql-binding":"2.1.1","graphql-import":"0.5.2","graphql-tools":"3.0.1","http-link-dataloader":"^0.1.2","jsonwebtoken":"8.2.1","subscriptions-transport-ws":"0.9.8"},"devDependencies":{"@types/graphql":"0.13.0","@types/jsonwebtoken":"7.2.7","@types/node":"10.0.3","ava":"0.25.0","copyfiles":"2.0.0","graphql":"0.13.2","semantic-release":"^15.5.2","tslint":"5.9.1","tslint-config-standard":"7.0.0","typescript":"2.8.3"},"peerDependencies":{"graphql":"^0.11.0 || ^0.12.0 || ^0.13.0"},"release":{"branch":"jdn/add-externalLink"},"description":"[![CircleCI](https://circleci.com/gh/prismagraphql/prisma-binding.svg?style=shield)](https://circleci.com/gh/prismagraphql/prisma-binding) [![npm version](https://badge.fury.io/js/prisma-binding.svg)](https://badge.fury.io/js/prisma-binding)","_id":"@ambler/prisma-binding@2.1.0-ambler.2","dist":{"shasum":"22115a7c307c240b28d5e334940c9bfcbcbaaa31","integrity":"sha512-k+ZwqhhO4+BdiXI0wfIxv8nS39WqfCxwm2RuHbvAzg3ZPpR8P3d7TYkWfvMfmT0bh7Mu1qZhT8z4OfNTmz/2JA==","tarball":"https://registry.npmjs.org/@ambler/prisma-binding/-/prisma-binding-2.1.0-ambler.2.tgz","fileCount":55,"unpackedSize":65394,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFGmbAA+F1xLmPZcTK5F9CPr8/IvISAU9lwRFV1B/0eNAiEA57PEm/BFYnshI76u3TeMJlVerTOensrXjgitv7Gie/E="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiZbkRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWqw/9HtBvCdGuWhkHYFrViKK877Wt5qrAR5DXPOquhVpTyHYQoy0p\r\njnlUxNqlnU2AbsRkliFkvwCImhptsgjpt0JC/0YdQyujyn7LqPVPW/FzG2q2\r\n2i2FVSAPNhppuuO+EZ/QqLbFIY36EhAKmdAEJM5nTfLE/kCdhCbmD4AXgHuu\r\nRn/GczJlnetOSNLgyEUpujpKZtHyBbh7ngETIbWPmjEZmlEWIqvWQpgh3/3x\r\nLbs0P9s89v5mfTQ4TTrcBBTY3PboYnvRLKeEHrFTGOFirpkWLOzoB2RCekZA\r\nvmO+Uje+4RldQ0ChHBOyMHuWdRKarO+xMQ/awMQjFMNtHwGz4ES5SCBSF1nJ\r\nDDzhXvvRzroXZM9nb3J70Qa5D2zk79WeQVo06zz5osXkC4ljNox6Ib03Se71\r\nAZiaHRJTcfwaOoZOeVZ/3aJCz7UK0NNjnDvEJFJUTxICXmvvCL7J0qoFygzZ\r\nyvdnQUDlu6jQ2dyy9tFT/G/TxwGX9oZGe9thvE3pSIf4Yfa2rrcncuSNFZLo\r\ntZvCMBtwxBVzFM3unFerxTyqrf1ANv4b8S+wA7kXNNsD/ER5+ltWDLNLEvE6\r\nGqu7Hdio9tTzrKitrkP6aNc4ulngwgzkQ/nx3SPCVQc4FsQa7UEci1oP1wwH\r\nm/p+WaiD8qmFgIVYd79AH+TWc1+gB/WD0DU=\r\n=nqAV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"chabou","email":"chabup@delean.fr"},"directories":{},"maintainers":[{"name":"chabou","email":"chabup@delean.fr"},{"name":"nbarray","email":"nbarray@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/prisma-binding_2.1.0-ambler.2_1650833681442_0.9155925507683844"},"_hasShrinkwrap":false}},"time":{"created":"2022-04-23T14:55:14.369Z","2.1.0-ambler.0":"2022-04-23T14:55:14.604Z","modified":"2022-05-19T19:03:47.114Z","2.1.0-ambler.1":"2022-04-24T18:55:41.024Z","2.1.0-ambler.2":"2022-04-24T20:54:41.681Z"},"maintainers":[{"email":"seb91.lm@gmail.com","name":"rhaven"},{"email":"chabup@delean.fr","name":"chabou"},{"email":"nbarray@gmail.com","name":"nbarray"}],"description":"[![CircleCI](https://circleci.com/gh/prismagraphql/prisma-binding.svg?style=shield)](https://circleci.com/gh/prismagraphql/prisma-binding) [![npm version](https://badge.fury.io/js/prisma-binding.svg)](https://badge.fury.io/js/prisma-binding)","homepage":"https://github.com/amblerhq/prisma-binding","repository":{"type":"git","url":"git+ssh://git@github.com:amblerhq/prisma-binding.git"},"contributors":[{"name":"Kim Brandwijk","email":"kim.brandwijk@gmail.com"},{"name":"Tim Suchanek","email":"suchanek@prisma.io"}],"author":{"name":"Johannes Schickling","email":"johannes@graph.cool"},"bugs":{"url":"https://github.com/amblerhq/prisma-binding/issues"},"license":"MIT","readme":"# prisma-binding\n\n[![CircleCI](https://circleci.com/gh/prismagraphql/prisma-binding.svg?style=shield)](https://circleci.com/gh/prismagraphql/prisma-binding) [![npm version](https://badge.fury.io/js/prisma-binding.svg)](https://badge.fury.io/js/prisma-binding)\n\nGraphQL Binding for Prisma services (GraphQL Database)\n\n## Overview\n\n`prisma-binding` provides a convenience layer for building GraphQL servers on top of Prisma services. In short, it simplifies implementing your GraphQL resolvers by _delegating_ execution of queries (or mutations) to the API of the underlying Prisma database service.\n\nHere is how it works:\n\n1. Create your Prisma service by defining data model\n1. Download generated database schema definition `prisma.graphql` (contains the full CRUD API)\n1. Define your application schema, typically called `app.graphql`\n1. Instantiate `Prisma` with information about your Prisma service (such as its endpoint and the path to the database schema definition)\n1. Implement the resolvers for your application schema by delegating to the underlying Prisma service using the generated delegate resolver functions\n\n> **Note**: If you're using a [GraphQL boilerplate](https://github.com/graphql-boilerplates/) project (e.g. with `graphql create`), the Prisma binding will already be configured and a few example resolvers implemented for you. You can either try the _dynamic binding_ (e.g. in the [`node-basic`](https://github.com/graphql-boilerplates/node-graphql-server/tree/master/basic) boilerplate) or a _static binding_ (e.g in the [`typescript-basic`](https://github.com/graphql-boilerplates/typescript-graphql-server/tree/master/basic) boilerplate).\n\n## Install\n\n```sh\nyarn add prisma-binding\n# or\nnpm install --save prisma-binding\n```\n\n## Example\n\nConsider the following data model for your Prisma service:\n\n```graphql\ntype User {\n  id: ID! @unique\n  name: String\n}\n```\n\nIf you instantiate `Prisma` based on this service, you'll be able to send the following queries/mutations:\n\n```js\n// Instantiate `Prisma` based on concrete service\nconst prisma = new Prisma({\n  typeDefs: 'schemas/database.graphql',\n  endpoint: 'https://us1.prisma.sh/demo/my-service/dev',\n  secret: 'my-super-secret-secret'\n})\n\n// Retrieve `name` of a specific user\nprisma.query.user({ where: { id: 'abc' } }, '{ name }')\n\n// Retrieve `id` and `name` of all users\nprisma.query.users(null, '{ id name }')\n\n// Create new user called `Sarah` and retrieve the `id`\nprisma.mutation.createUser({ data: { name: 'Sarah' } }, '{ id }')\n\n// Update name of a specific user and retrieve the `id`\nprisma.mutation.updateUser({ where: { id: 'abc' }, data: { name: 'Sarah' } }, '{ id }')\n\n// Delete a specific user and retrieve the `id`\nprisma.mutation.deleteUser({ where: { id: 'abc' } }, '{ id }')\n```\n\nUnder the hood, each of these function calls is simply translated into an actual HTTP request against your Prisma service (using [`graphql-request`](https://github.com/graphcool/graphql-request)).\n\nThe API also allows to ask whether a specific node exists in your Prisma database:\n\n```js\n// Ask whether a post exists with `id` equal to `abc` and whose\n// `author` is called `Sarah` (return boolean value)\nprisma.exists.Post({\n  id: 'abc',\n  author: {\n    name: 'Sarah'\n  }\n})\n```\n\n## API\n\n### `constructor(options: PrismaOptions): Prisma`\n\nThe `PrismaOptions` type has the following fields:\n\n| Key | Required |  Type | Default | Note |\n| ---  | --- | --- | --- | --- |\n| `typeDefs` | Yes | `string` |  - | Type definition string or file path to the schema definition of your Prisma service (typically a file called `database.graphql` or `prisma.graphql`) |\n| `endpoint` | Yes | `string` |  - | The endpoint of your Prisma service |\n| `secret` | Yes | `string` |  - | The secret of your Prisma service |\n| `fragmentReplacements` | No | `FragmentReplacements` |  `null` | A list of GraphQL fragment definitions, specifying fields that are required for the resolver to function correctly |\n| `debug` | No | `boolean` |  `false` | Log all queries/mutations to the console |\n\n### `query` and `mutation`\n\n`query` and `mutation` are public properties on your `Prisma` instance. They both are of type `Query` and expose a number of auto-generated delegate resolver functions that are named after the fields on the `Query` and `Mutation` types in your Prisma database schema.\n\nEach of these delegate resolvers in essence provides a convenience API for sending queries/mutations to your Prisma service, so you don't have to spell out the full query/mutation from scratch and worry about sending it over HTTP. This is all handled by the delegate resolver function under the hood.\n\nDelegate resolver have the following interface:\n\n```js\n(args: any, info: GraphQLResolveInfo | string): Promise<T>\n```\n\nThe input arguments are used as follows:\n\n- `args`: An object carrying potential arguments for the query/mutation\n- `info`: An object representing the selection set of the query/mutation, either expressed directly as a string or in the form of `GraphQLResolveInfo` (you can find more info about the `GraphQLResolveInfo` type [here](http://graphql.org/graphql-js/type/#graphqlobjecttype))\n\nThe generic type `T` corresponds to the type of the respective field. \n\n### `exists`\n\n`exists` also is a public property on your `Prisma` instance. Similar to `query` and `mutation`, it also exposes a number of auto-generated functions. However, it exposes only a single function per type. This function is named according to the root field that allows the retrieval of a single node of that type (e.g. `User` for a type called `User`). It takes a `where` object as an input argument and returns a `boolean` value indicating whether the condition expressed with `where` is met.\n\nThis function enables you to easily check whether a node of a specific type exists in your Prisma database.\n\n### `request`\n\nThe `request` method lets you send GraphQL queries/mutations to your Prisma service. The functionality is identical to the auto-generated delegate resolves, but the API is more verbose as you need to spell out the full query/mutation. `request` uses [`graphql-request`](https://github.com/graphcool/graphql-request) under the hood.\n\nHere is an example of how it can be used:\n\n```js\nconst query = `\n  query ($userId: ID!){\n    user(id: $userId) {\n      id\n      name\n    }\n  }\n`\n\nconst variables = { userId: 'abc' }\n\nprisma.request(query, variables)\n  .then(result => console.log(result))\n// sample result:\n// {\"data\": { \"user\": { \"id\": \"abc\", \"name\": \"Sarah\" } } }\n```\n\n### `forwardTo`\n\nIf you just want to forward a query to the exact same underlying prisma query, you can use `forwardTo`:\n\n```js\nconst {forwardTo} = require('prisma-binding')\n\nconst resolvers = {\n  Query: {\n    posts: forwardTo('db')\n  }\n}\n\nconst server = new GraphQLServer({\n  typeDefs: './src/schema.graphql',\n  resolvers,\n  context: req => ({\n    ...req,\n    db: new Prisma({\n      typeDefs: 'src/generated/prisma.graphql',\n      endpoint: '...',\n      secret: 'mysecret123',\n    }),\n    debug: true,\n  }),\n})\n\nserver.start(\n  () => console.log(`Server is running on http://localhost:4000`),\n)\n```\n\n\n## Usage\n\n- [graphql-boilerplates](https://github.com/graphql-boilerplates).\n- [graphql-server-example](https://github.com/graphcool/graphql-server-example).\n\n## Next steps\n\n- Code generation at build-time for the auto-generated delegate resolvers\n\n<p align=\"center\"><a href=\"https://oss.prisma.io\"><img src=\"https://imgur.com/IMU2ERq.png\" alt=\"Prisma\" height=\"170px\"></a></p>\n\n","readmeFilename":"README.md"}