Skip to content

Override some of PostgraPhile's core inflectors with Artetecha's own favourite inflection rules.

License

Notifications You must be signed in to change notification settings

artetecha/postgraphile-artetecha-inflector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

postgraphile-artetecha-inflector

Override some of PostgraPhile's core inflectors with Artetecha's own favourite inflection rules.

Core inflection rules

allRows:

Given a type, e.g. Metadatum:

  • Core allRows would be allMetadata
  • Artetecha's is metadataConnection

allRowsSimple

Given a type, e.g. Metadatum:

  • Core allRowsSimple would be allMetadataList
  • Artetecha's is metadata

singleRelationByKeys

Given a type Author with a 1:1 relationship to Metadatum on some id field

  • Core would create a field metadatumByAuthorId field on Author
  • Artetecha would simply create a field metadatum

singleRelationByKeysBackwards

Given a type Author with a 1:1 relationship to Metadatum on some id field

  • Core would create a field authorByAuthorId field on Metadatum
  • Artetecha would simply create a field author

manyRelationByKeys

Given a type Author with a 1:N relationship to Metadata on some id field

  • Core would create a field metadataByAuthorId field on Author
  • Artetecha would simply create a field metadataConnection

manyRelationByKeysSimple

Given a type Author with a 1:N relationship to Metadata on some id field

  • Core would create a field metadataByAuthorIdList field on Author
  • Artetecha would simply create a field metadata

Third-party inflection rules

pgNestedFieldName

This is implemented by postgraphile-plugin-nested-mutations.

Given a type Author with a 1:N relationship to Metadata on some id field

  • The plugin would create a field authorToAuthorId field on the mutation createMetadatum
  • The plugin would also create a field metadataUsingId field on the mutation createAuthor
  • Artetecha would simply create a field author in the first case and a field metadata in the second

About

Override some of PostgraPhile's core inflectors with Artetecha's own favourite inflection rules.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published