Package Exports
- @graphile-contrib/pg-simplify-inflector
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-contrib/pg-simplify-inflector) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@graphile-contrib/pg-simplify-inflector
Simplifies relation names; e.g. postsByAuthorId becomes simply posts.
Installation:
yarn add @graphile-contrib/pg-simplify-inflectoror
npm install --save @graphile-contrib/pg-simplify-inflectorUsage:
CLI:
postgraphile --append-plugins @graphile-contrib/pg-simplify-inflectorLibrary:
const PgSimplifyInflectorPlugin =
require('@graphile-contrib/pg-simplify-inflector');
// ...
app.use(
postgraphile(process.env.AUTH_DATABASE_URL, "app_public", {
appendPlugins: [
PgSimplifyInflectorPlugin,
],
// ... other settings ...
})
);Handling field conflicts:
If you have two relations that will result in a conflict (e.g.
postsByAuthorId and postsByEditorId would both become posts with this
plugin) then you will need to rename one of them - you can do so using smart
comments, e.g.:
comment on constraint posts_editor_id_fkey on posts is
E'@foreignFieldName editedPosts\n@fieldName editor';