0.0.4 • Published 7 years ago
postgraphile-artetecha-inflector v0.0.4
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
allRowswould beallMetadata - Artetecha's is
metadataConnection
allRowsSimple
Given a type, e.g. Metadatum:
- Core
allRowsSimplewould beallMetadataList - 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
metadatumByAuthorIdfield onAuthor - 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
authorByAuthorIdfield onMetadatum - 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
metadataByAuthorIdfield onAuthor - 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
metadataByAuthorIdListfield onAuthor - 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
authorToAuthorIdfield on the mutationcreateMetadatum - The plugin would also create a field
metadataUsingIdfield on the mutationcreateAuthor - Artetecha would simply create a field
authorin the first case and a fieldmetadatain the second