Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@graphile-contrib/pg-simplify-inflector

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphile-contrib/pg-simplify-inflector - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

13

index.js

@@ -11,3 +11,12 @@ /*

module.exports = function PgSimplifyInflectorPlugin(builder) {
module.exports = function PgSimplifyInflectorPlugin(builder, { pgSimpleCollections, pgOmitListSuffix }) {
const hasConnections = pgSimpleCollections !== "only";
const hasSimpleCollections = pgSimpleCollections === "only" || pgSimpleCollections === "both";
if (hasConnections && hasSimpleCollections && pgOmitListSuffix) {
throw new Error("Cannot omit -list suffix (`pgOmitListSuffix`) if both relay connections and simple collections are enabled.");
}
if (hasSimpleCollections && !hasConnections && pgOmitListSuffix !== true && pgOmitListSuffix !== false) {
console.warn("You can simplify the inflector further by adding `{graphileOptions: {pgOmitListSuffix: true}}` to the options passed to PostGraphile, however be aware that doing so will mean that later enabling relay connections will be a breaking change. To dismiss this message, set `pgOmitListSuffix` to false instead.");
}
builder.hook("inflection", inflection => {

@@ -44,3 +53,3 @@ return {

return this.camelCase(
`${this.pluralize(this._singularizedTableName(table))}`
`${this.pluralize(this._singularizedTableName(table))}` + (pgOmitListSuffix ? '' : '-list')
);

@@ -47,0 +56,0 @@ },

2

package.json
{
"name": "@graphile-contrib/pg-simplify-inflector",
"version": "2.0.0",
"version": "2.0.1",
"description": "Simplifies the graphile-build-pg inflector to trim the `ByFooIdAndBarId` from relations",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc