JSPM

graphile-column-privileges-mutations

0.0.9
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 40
  • Score
    100M100P100Q75170F
  • License SEE LICENSE IN LICENSE

graphile mutations for tables with column privileges

Package Exports

  • graphile-column-privileges-mutations

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (graphile-column-privileges-mutations) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

graphile-column-privileges-mutations Build Status

npm install graphile-column-privileges-mutations 

This PostGraphile schema plugin was built to enable use of column-level SELECT grants, while still providing auto-generated mutations within PostGraphile. It works by using primary or unique constraints.

To give you a sense of why/where this plugin was born: https://github.com/graphile/graphile-engine/issues/260

Usage

  1. Disable the default mutations in your graphile settings object
  2. Append the new plugins!
  3. Enjoy!
app.use(
  postgraphile(connectionStr, schemas, {
    appendPlugins: [
      PgMutationCreatePlugin,
      PgMutationUpdateDeletePlugin
    ],
    graphileBuildOptions: {
      // disable the default mutations
      pgDisableDefaultMutations: true
    }
  })
);

Examples

Example with app users and select grants here:

https://github.com/pyramation/graphile-column-select-grants-example

Testing

createdb mutation_example
psql mutation_example < sql/roles.sql
psql mutation_example < sql/user.sql
psql mutation_example < sql/schema.sql
yarn test