Skip to content

pyramation/graphile-column-privileges-mutations

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
sql
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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: graphile/graphile-engine#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

About

enable use of column-level SELECT grants, while still providing auto-generated mutations within PostGraphile

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published