{"_id":"@autotelic/fastify-postgraphile","_rev":"2-1c87960d8ef2f5316d1ee8913dce1954","name":"@autotelic/fastify-postgraphile","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.0":{"name":"@autotelic/fastify-postgraphile","version":"0.0.0","description":"PostGraphile plugin for fastify","main":"index.js","directories":{"test":"test"},"scripts":{"test":"test","example":"fastify start example.js","lint":"standard","fix":"npm run lint -- --fix","validate":"npm run lint && npm run test"},"repository":{"type":"git","url":"git+https://github.com/autotelic/fastify-postgraphile.git"},"keywords":["fastify","postgraphile","postgresql","postgres","psql","graphql","gql"],"author":{"name":"Autotelic Development Ltd","email":"info@autotelic.com"},"license":"MIT","bugs":{"url":"https://github.com/autotelic/fastify-postgraphile/issues"},"homepage":"https://github.com/autotelic/fastify-postgraphile#readme","dependencies":{"@graphile-contrib/pg-simplify-inflector":"^6.1.0","fastify-plugin":"^3.0.0","postgraphile":"^4.10.0-alpha.0"},"devDependencies":{"tap":"^14.0.0","fastify":"^3.0.0","fastify-cli":"^2.5.1","standard":"^14.3.4","lint-staged":"^10.2.11"},"lint-staged":{"*.{js,jsx}":["npm run fix"]},"gitHead":"b79228417e2f8ba27c52bd27162668fbda079cbc","_id":"@autotelic/fastify-postgraphile@0.0.0","_nodeVersion":"12.16.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-X+8UERDNb7kEzxEkBVic77XXxjYWbrNtX3fwnr2VQblnjXDghfylBB9rSPJj94BUH0ZsbDMpRaaGYDkCdLkw5g==","shasum":"b9b238653960efe9b7b39e30abca8eb606ecf63b","tarball":"https://registry.npmjs.org/@autotelic/fastify-postgraphile/-/fastify-postgraphile-0.0.0.tgz","fileCount":6,"unpackedSize":5686,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuFEMCRA9TVsSAnZWagAAmeIP/j/ZPgwsmAAcISzMsn3t\n2YpChyuXsycxMxAcMfvxWlEk4gAAms4PSl+EAEX4mWPFgBISuVwsFQ+g+677\nEzreCt4q7CCaJv4Pn28rgsU2pYRwA27BqIcxgmI9LgoZtV4EvPSeYl4CBquv\nvhhzHziGNnEPzc6G/yeay7ccQ+A5S4Ewoo8CS0HYfy5l9Ui8H88vNaeXbpUG\ngwaFKGau2lWaCSqsgEX1O9Ekf5scDVtRhSi7Ti4UdZ0lpa6GzV5T/5wJdXfI\nW6+LryoabjOgzqMTLsSRDkB08IenSEQ9Z54voGUsYQ3jTim3VX7KEYHXcjvL\np/Kp+IofVaPagoDdFZ5J4m4kBcjivO8IhqB+wD81b5gUAniOxu+sUDZG7mPf\nvmWM8I/UxoooAJqn+3wavzVzD94aoXUpw34vZqZyYn1Mi0lphstKEDvdjkdV\naqi6UNO3gOg/943bfeArLUwYhp46gNY+PsOGRrbhq2Wr7g71ARAYkay5ZKJw\nuMeyHIw0wIrxLkoyO3mSVkBrhL7Pj3RPP+q1jinpaq+78RvjfoysQN13l7Gj\nNhdPtNCx0+rPLIGkuAA6j7jvlTqxKTsC0xl5gSclIFL59aE116CVaqgdq29c\nTQNosm2QUprxC1AOpiaGT+cDWr2SiiWWtt4uJGS++USAdvKXjlmnk+roq0GE\nmzy2\r\n=RrXG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEjvm2K8K08mNYd9zBBeUxnOjL2oZadtPsLDQze6SlbpAiBionq1eA7k05qLPacQPVQ4HQ+R+jfIrZtRIU+ii8csdw=="}]},"_npmUser":{"name":"autotelic","email":"info+npm@autotelic.com"},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fastify-postgraphile_0.0.0_1605914891954_0.3144281138548526"},"_hasShrinkwrap":false},"0.1.0":{"name":"@autotelic/fastify-postgraphile","version":"0.1.0","description":"PostGraphile plugin for fastify","main":"index.js","scripts":{"test":"tap -R classic -j1","example":"fastify start examples/example.js","lint":"standard","fix":"npm run lint -- --fix","validate":"npm run lint && npm run test"},"repository":{"type":"git","url":"git+https://github.com/autotelic/fastify-postgraphile.git"},"keywords":["fastify","postgraphile","postgresql","postgres","psql","graphql","gql"],"author":{"name":"Autotelic Development Ltd","email":"info@autotelic.com"},"license":"MIT","bugs":{"url":"https://github.com/autotelic/fastify-postgraphile/issues"},"homepage":"https://github.com/autotelic/fastify-postgraphile#readme","dependencies":{"@graphile-contrib/pg-simplify-inflector":"^6.1.0","fastify-plugin":"^3.0.0","lodash.mergewith":"^4.6.2","postgraphile":"^4.10.0-alpha.0"},"devDependencies":{"fastify":"^3.0.0","fastify-cli":"^2.5.1","husky":"^4.3.8","lint-staged":"^10.2.11","standard":"^14.3.4","tap":"^14.0.0"},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{js,jsx}":["npm run fix"]},"engines":{"node":">= 12.18.4"},"gitHead":"2fc693025aded1b2b7ebc0d873c17a691b87a4d0","_id":"@autotelic/fastify-postgraphile@0.1.0","_nodeVersion":"12.20.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-r95pT/qNg5h+dSkIE9xfoKms6rugRZfrO5WB7H1cttrWBvOOj+FdoFOIx1N/NjiUUEN8yoVBmM5bUcgXWCUrHg==","shasum":"344d01bfe79bd39329c65bbdaf95e93cbbe71aac","tarball":"https://registry.npmjs.org/@autotelic/fastify-postgraphile/-/fastify-postgraphile-0.1.0.tgz","fileCount":5,"unpackedSize":8139,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCvzPCRA9TVsSAnZWagAA6ZUP+QFUqeREQWcVxc9aV5Rv\nyicVPpilhkIIMfD+jaToPi+o1doQcrzNjE2/gXweUfCboaBbtMDZ7pqmcPOA\nlWl7IqFSyRJNk52Y5HfItjsKVVaVhUNB0ssOGZ39GyOh2U1vPYz4MvbD81Nz\nncoi3UYfPwZCkFUT2SdOKI65T1RNLMOHJpYyDjgs6iLIzkNXyPyJqDHH98gD\nhKcfX62NJ6IXnlRe+LZkf63tubkagBEpxfcU007GHDq0qtlLmnYSpXzHuv8P\n2DMTilX8i9PKqgKfW4dwQtUP84YKcin3UgzQr4WcOrmAnmXbbrSshHQAKNl5\n/zQJoOsbmzaNuMtEazVWi8xcjhgtH9vX/JqWDtlzUDMPpRtpN2CwPOVRdhIh\n7mymWmPg2f0rwZNp/Oelc7rnbZknAaWPR5OGKA9hg8keE6dL3ePNyQLHqXOx\nMdtdhBrFl2DN3u6TbmIVnsTX3DaO+yLoFBQSSIwWoRUIbxED5jUCMrYmUn4F\nQqfjNF6iVFUTqlgHxyUr+gN03yBDd8aXLYkJABAKuCjub7wOrCSiATsCOy6H\nloO3OKy5qIkwqYEXqR2yEZJUPKkIh70EeV37Xnwo3USjFosizJ20GtZr+nHo\nAHb4rdpp6Fd0UFWTEe2B+0p96GPBpGEVnCjkpjkLR1yQOzVTj/CI+lemaPoa\nWIfu\r\n=WOXS\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEQeFVEpwj/wqc29kAfVRh8avswW1mLjD64QoS0egiQ7AiBWhA59dCMm20uJrcKz1K6i3iUfktYgLxFWmlG6oxRb9A=="}]},"_npmUser":{"name":"autotelic","email":"info+npm@autotelic.com"},"directories":{},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fastify-postgraphile_0.1.0_1611332814573_0.5555208143453685"},"_hasShrinkwrap":false}},"time":{"created":"2020-11-20T23:28:11.910Z","0.0.0":"2020-11-20T23:28:12.068Z","modified":"2022-04-04T16:40:48.779Z","0.1.0":"2021-01-22T16:26:54.730Z"},"maintainers":[{"name":"autotelic","email":"info+npm@autotelic.com"}],"description":"PostGraphile plugin for fastify","homepage":"https://github.com/autotelic/fastify-postgraphile#readme","keywords":["fastify","postgraphile","postgresql","postgres","psql","graphql","gql"],"repository":{"type":"git","url":"git+https://github.com/autotelic/fastify-postgraphile.git"},"author":{"name":"Autotelic Development Ltd","email":"info@autotelic.com"},"bugs":{"url":"https://github.com/autotelic/fastify-postgraphile/issues"},"license":"MIT","readme":"# fastify-postgraphile\n\nFastify plugin for PostGraphile.\n\nTakes inspiration from the following resources:\n- [Using Postgraphile as a library](https://www.graphile.org/postgraphile/usage-library)\n- [Postgraphile's Fastify v3 example](https://github.com/graphile/postgraphile/blob/v4/examples/servers/fastify3/rum-and-raisin.ts)\n\n## Usage\n\n```sh\nnpm install @autotelic/fastify-postgraphile\n```\n\n```js\nconst fastifyPostGraphile = require('@autotelic/fastify-postgraphile')\nconst { DATABASE_URL } = process.env\n\nmodule.exports = function (fastify, options, next) {\n    fastify.register(fastifyPostGraphile, { database: DATABASE_URL })\n\n    fastify.get('/', (req, reply) => {\n      reply.type('application/json')\n      reply.send({ foo: 'bar' })\n    })\n\n    fastify.post('/', (req, reply) => {\n      reply.type('application/json')\n      reply.send({ hello: 'world' })\n    })\n\n    next()\n}\n```\n\n### API: fastifyPostGraphile(database, schemas, settings)\n\n| Name | Status | Type | Default | Description |\n| ------- | :---: | :---: | :---: | --- |\n| `database` | **Required** | String/Object | - | An object or string that will be passed to the pg library and used to connect to a PostgreSQL backend, OR a pg.Pool to use. |\n| `schemas` | Optional | String/[String] | 'public' | A string, or array of strings, which specifies the PostgreSQL schema(s) to expose via PostGraphile; defaults to 'public' |\n| `settings` | Optional | Object | - | An object containing [PostGraphile options][options-reference] to be combined with the [default recommended options][Recommended-Options]. |\n\n### Default Options\n\nThe default options applied by `fastify-postgraphile` are the [recommended PostGraphile options][Recommended-Options].\n\nThese defaults can be added to or changed by passing additional PostGraphile Options in with the `settings` object. The `extendedErrors` and `appendPlugins` arrays will be concatenated with any new options passed in.\n\nNote: If you need to disable the default [`simplifyInflector` plugin][pg-simplify-inflector], pass the exported reference to it into the `skipPlugins` option array. \n\ne.g.\n```js\nskipPlugins: [fastifyPostGraphile.DEFAULT_INFLECTOR]\n```\n\n## Run the example\n\n#### Configure and run a local Postgres Container\n```\ndocker run --name postgraphile-example \\\n  -e POSTGRES_PASSWORD=examplepassword \\\n  -d -p 5432:5432 postgres\n```\n```\nifconfig -u | grep 'inet ' | grep -v 127.0.0.1 | cut -d\\  -f2 | head -1\n# <your-public-ip> <-- Copy this\n```\n#### Add the following to your `.envrc` file:\n`export DATABASE_URL=postgres://postgres:examplepassword@<your-public-ip>:5432/postgres?sslmode=disable`\n\nAllow .envrc file\n```sh\ndirenv allow .\n```\n### Run the example migration\n```sh\nnpx -p pg -p node-pg-migrate -c \"node-pg-migrate up -m examples/migrations\"\n```\n\n#### Run the server\n```sh\nnpm run example -- -l info -w\n```\n\n#### Make Requests to the Server\n```\nhttp localhost:3000\nhttp post localhost:3000\n```\n\n#### Explore Graphiql\n\n[http://localhost:3000/graphiql](http://localhost:3000/graphiql)\n\n[Recommended-Options]: https://www.graphile.org/postgraphile/usage-library/#recommended-options\n[options-reference]: https://www.graphile.org/postgraphile/usage-library/#api-postgraphilepgconfig-schemaname-options\n[pg-simplify-inflector]: https://www.npmjs.com/package/@graphile-contrib/pg-simplify-inflector","readmeFilename":"README.md"}