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
4
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 Versions

7.0.0-alpha.1

Diff

benjie
published 6.1.0 •

Changelog

Source

v6.1.0

Add @listSuffix smart tag

Previously there was no easy way to override pgOmitListSuffix on a per-entity basis. With the @listSuffix tag you can selectively control naming of both collection types:

create table companies (id serial primary key);
comment on table companies is E'@listSuffix omit';

By default (pgOmitListSuffix = null and simpleCollections = 'both') this produces:

-  allCompanies(
+  companiesConnection(
-  allCompaniesList(
+  companies(
benjie
published 6.0.0 •

Changelog

Source

v6.0.0

Pluralization fixes

Previously we fed the entire table/etc name into pluralize but this causes issues for special cases, for example while pluralize('genus') correctly gives genera, pluralize('old_genus') would give old_genus which is not correct.

Now we segment on underscores/capitals and only pluralize the final segment, so we're more likely to get the correct result.

This affects everywhere in your entire GraphQL schema where pluralize/singularize is used.

Simplify multi-key relationships.
  foreign key (organization_id, team_id, goal_uuid) references goals

Now named better:

-  goalByOrganizationIdAndTeamIdAndGoalUuid: Goal
+  organizationTeamGoal: Goal
Unique relations get shorter-named reverse field.

This was a bug (or, really, an omission) in v5.

For this table:

create table mascots (
    id serial primary key,
    company_id int unique not null references companies,
    name text not null
);

Previously we had the plural relationship simplified:

-  mascotsByCompanyId(
+  mascots(

But the singular was not. This update changes the singular too:

-  mascotByCompanyId: Mascot
+  mascot: Mascot
benjie
published 5.0.0-beta.1 •

Changelog

Source

v5.0.0-beta.1

benjie
published 5.0.0-beta.0 •

Changelog

Source

v5.0.0-beta.0

More advanced guesses at field names for reverse relations. Ability to omit list suffix, simplify patch names, turn on/off simplifying of the 'all' from 'allUsers', ability to change the 'ById' primary key fields to not have that suffix and instead have the node ID fetchers have a suffix.

benjie
published 4.0.0-alpha.0 •

benjie
published 3.0.0 •

Changelog

Source

v3.0.0

Simplifies naming in more of the schema.

benjie
published 2.0.1 •

benjie
published 2.0.0 •

Changelog

Source

v2.0.0

Breaking change: single relation names based on a single key are now named after the key rather than the target table so long as the key is of the form foo_id, foo_uuid.

create table posts (
  id serial primary key,
  author_id int not null references users,
  body text not null
);
 type Post {
   nodeId: ID!
   id: Int!
   authorId: Int!
-  user: User
+  author: User
   body: String!
 }
benjie
published 1.0.0 •

Changelog

Source

v1.0.0

Initial release

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