{"_id":"@_lukepatrick/postgraphile-upsert-plugin","_rev":"1-53849333623adbfd0831a2fd2164d418","name":"@_lukepatrick/postgraphile-upsert-plugin","dist-tags":{"latest":"1.5.0"},"versions":{"1.5.0":{"name":"@_lukepatrick/postgraphile-upsert-plugin","description":"add postgres upsert mutations to postgraphile","version":"1.5.0","main":"build/postgraphile-upsert.js","engines":{"node":">=8"},"maintainer":"lukepatrick","license":"MIT","devDependencies":{"@types/bluebird":"^3.5.24","@types/dockerode":"^2.5.9","@types/execa":"^0.9.0","@types/nanographql":"^2.0.1","@types/pg":"^7.4.11","ava":"1.1.0","bluebird":"^3.5.3","dockerode":"^2.5.7","execa":"^1.0.0","freeport":"^1.0.5","husky":"^1.2.0","lint-staged":"^8.1.0","nanographql":"^2.0.0","node-fetch":"^2.3.0","pg":"^7.6.1","postgraphile":"^4.0.1","postgraphile-core":"4.2.0","prettier-standard":"^9.1.1","typescript":"^3.1.6","semantic-release":"^15.12.1"},"scripts":{"build":"tsc","format":"prettier-standard '{src,test,scripts}/**/*.{js,jsx,ts,tsx}'","test":"npm run build run-tests","run-tests":"ava build/**/*.test.js","semantic-release":"semantic-release"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"linters":{"{src,test,scripts}/**/*.{js,jsx,ts,tsx}":["yarn format","git add"]}},"ava":{"babel":false,"compileEnhancements":false},"repository":{"type":"git","url":"https://github.com/lukepatrick/postgraphile-upsert-plugin"},"publishConfig":{"access":"public"},"release":{"repositoryUrl":"git@github.com:lukepatrick/postgraphile-upsert-plugin.git"},"keywords":["postgres","pg","postgraphile","upsert","plugin","mutation"],"_id":"@_lukepatrick/postgraphile-upsert-plugin@1.5.0","dist":{"shasum":"5f9e3b179bc9a3b7eeb55a9420c48555ff2339ab","integrity":"sha512-xYp8MB5lOFy3ssq/Bg2/co+XwZLmYGfmoaCyC/QztVj9GCan8BPltFzetB/gZ4S7zO0WV6/LPC/HFbaENm76QA==","tarball":"https://registry.npmjs.org/@_lukepatrick/postgraphile-upsert-plugin/-/postgraphile-upsert-plugin-1.5.0.tgz","fileCount":6,"unpackedSize":15579,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdHS+UCRA9TVsSAnZWagAAG/gP/0xKxhuW/CeRJHnDWuOM\nSH6JwUupZSRzZkm7/P9ePPu3KpRg/zv6D/Sif9ohZLmJdZmQKD3cbH+aj8Ga\n6cKDIfXF/p2iTHu3T0Kt6OeT9szuPJjvEO758ixZ/qG4ffJ5qFKwdPiiQREO\nI89A87Ti3ISSsv9Mmzoj8+C09Fw67RKXG+PGVu1QjvM9tgK/gQ8APb5uJJwk\neNMNpU1JugWP7/4g2WWJYN05JHKPmAVi1MWwu8fc1NQtWcSvqNxgcSn4b21I\nRpsQSpfRkqw+Ao2qXxYl7VEZ3X5eStnvZHrkkOdTEt0kKXUmlWoIEekaMc9q\nHuTYD7/tGJBTfwHpY88n0a6xcsCxG5hKQU0KQ2CMjGWvieAUEjXEQqO4Zs2d\nQF5vp5PEKiLeNjaNOsJAJYn4Ei44OyX1GxKtYBG7dRhDlaRJaY1Hyt3kjkId\nyLeG5c7u3T4Nw39iQUDXkHES6o4nlmDjzk8LS3Ga45xx6gUiZNMCpJezWRFN\n4ibWfOzDwrQxzj+YM3cuQ8AQsNRzb9pTYCXKtYmu1UwnIiFe3IDiKxh7/fcw\nuRE15iRt/ucLFZ0kUx8MsVjguQpIAOqoFlncRN3bLHH/aAvb3+ZVYyySENck\nb6Pm2iUil/9BeiZrSFpEyvDjFUl+gGAIWmxn4GOegDE/ZknZCYJGUHCxrH8F\n8n9v\r\n=9dE0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8gQnD3b0vASCPcGL3a94dLkM2Mr/TBenz3CTfB4RMJgIgdVOeuCjCkGmrYE1iys6fCGVV2Ue2q9j74fxcJyzhXXw="}]},"maintainers":[{"name":"_lukepatrick","email":"lukephilips@gmail.com"}],"_npmUser":{"name":"_lukepatrick","email":"lukephilips@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postgraphile-upsert-plugin_1.5.0_1562193812351_0.5350893030393356"},"_hasShrinkwrap":false}},"time":{"created":"2019-07-03T22:43:32.137Z","1.5.0":"2019-07-03T22:43:32.495Z","modified":"2022-04-04T10:51:32.245Z"},"maintainers":[{"name":"_lukepatrick","email":"lukephilips@gmail.com"}],"description":"add postgres upsert mutations to postgraphile","keywords":["postgres","pg","postgraphile","upsert","plugin","mutation"],"repository":{"type":"git","url":"https://github.com/lukepatrick/postgraphile-upsert-plugin"},"license":"MIT","readme":"# postgraphile-upsert-plugin\n\nAdd postgres `upsert` mutations to [postgraphile](https://www.graphile.org/postgraphile).\n\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) [![Greenkeeper badge](https://badges.greenkeeper.io/cdaringe/postgraphile-upsert.svg)](https://greenkeeper.io/) [![CircleCI](https://circleci.com/gh/cdaringe/postgraphile-upsert.svg?style=svg)](https://circleci.com/gh/cdaringe/postgraphile-upsert)\n\n## Getting Started\n\n### Install\n\n```bash\nyarn add @fullstackio/postgraphile-upsert-plugin\n```\n\n### CLI\n\n```bash\npostgraphile --append-plugins @fullstackio/postgraphile-upsert-plugin:PgMutationUpsertPlugin\n```\n\nSee [here](https://www.graphile.org/postgraphile/extending/#loading-additional-plugins) for\nmore information about loading plugins with PostGraphile.\n\n### Library\n\n```js\nconst express = require(\"express\");\nconst { postgraphile } = require(\"postgraphile\");\nconst {\n  PgMutationUpsertPlugin\n} = require(\"@fullstackio/postgraphile-upsert-plugin\");\n\nconst app = express();\n\napp.use(\n  postgraphile(pgConfig, schema, {\n    appendPlugins: [PgMutationUpsertPlugin]\n  })\n);\n\napp.listen(5000);\n```\n\n## Usage\n\nThis plugin creates an addition operation to `upsert<Table>` using a `where` clause, which is any unique constraint on the table. Supports multi-column unique indexes.\n\n## Example\n\n```sql\ncreate table bikes (\n  id serial PRIMARY KEY,\n  \"serialNumber\" varchar UNIQUE NOT NULL,\n  weight real,\n  make varchar,\n  model varchar\n)\n```\n\nAn upsert would look like this:\n\n```graphql\nmutation {\n  upsertBike(\n    where: { serialNumber: \"abc123\" }\n    input: {\n      bike: {\n        serialNumber: \"abc123\"\n        weight: 25.6\n        make: \"kona\"\n        model: \"cool-ie deluxe\"\n      }\n    }\n  ) {\n    clientMutationId\n  }\n}\n```\n\n## Credits\n\n- This is a fork of [jashmenn/postgraphile-upsert-plugin](https://github.com/jashmenn/postgraphile-upsert-plugin)\n- Which itself is a fork of the TypeScript [postgraphile-upsert-plugin](https://github.com/cdaringe/postgraphile-upsert)\n- Which itself is a fork of [the original upsert plugin](https://github.com/einarjegorov/graphile-upsert-plugin/blob/master/index.js)\n","readmeFilename":"readme.md"}