# @cloudcycle/postgraphile-plugin-prefix-schema

> Postgraphile plugin which prefixes the SQL schema to GraphQL types

Latest version **0.1.0** (published 2022-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @cloudcycle/postgraphile-plugin-prefix-schema
pnpm add @cloudcycle/postgraphile-plugin-prefix-schema
yarn add @cloudcycle/postgraphile-plugin-prefix-schema
bun add @cloudcycle/postgraphile-plugin-prefix-schema
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2022-09-08 |
| First published | 2022-08-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 20.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Isac Casapu |
| Maintainers | yitzikc |
| Keywords | Postgraphile, plugin, schema |

## Links

- npm: https://www.npmjs.com/package/@cloudcycle/postgraphile-plugin-prefix-schema
- Repository: https://github.com/CloudCycle/postgraphile-plugin-prefix-schema
- Homepage: https://github.com/CloudCycle/postgraphile-plugin-prefix-schema#readme
- Issues: https://github.com/CloudCycle/postgraphile-plugin-prefix-schema/issues
- npm.io page: https://npm.io/package/@cloudcycle/postgraphile-plugin-prefix-schema

## Dependencies (1)

- [graphile-utils](https://npm.io/package/graphile-utils.md) ^4.12.3

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2022-09-08
- 0.0.3 — 2022-08-25
- 0.0.3-pre3 — 2022-08-24
- 0.0.3-pre1 — 2022-08-22
- 0.0.1 — 2022-08-17

## README

postgraphile-plugin-prefix-schema
=================================


This plugin for PostGraphile prepends the name of the SQL schema to the types in the GraphQL schema generated by Postgrahile. It does so in a way matching the capitalization style of the original type, so that camel-case, capital-case etc. are preserved.

Limitations
-----------

Only a single SQL schema may be used. If multiple schemas are used (which PostGraphile allows), the plugin will abort with an error.

The plugin makes no attempt to adjust the names of enums which are specified using smart-comments on tables.

Installation
------------

Install using NPM or Yarn:
NPM:

```bash
npm install --save @cloudcycle/postgraphile-plugin-prefix-schema
```

Yarn:
```bash
yarn add @cloudcycle/postgraphile-plugin-prefix-schema
```

Usage
-----

CLI:

```bash
postgraphile --append-plugins @cloudcycle/postgraphile-plugin-prefix-schema
```

Library:

```javascript
import prefixSchemaPlugin from '@cloudcycle/postgraphile-plugin-prefix-schema';
```

Then add it to the appendPlugins array. E.g.:

```javascript
app.use(
  postgraphile(process.env.AUTH_DATABASE_URL, "app_public", {
    appendPlugins: [prefixSchemaPlugin],

    // Optional customisation
    graphileBuildOptions: {
      /*
       * Uncomment if you want simple collections to lose the 'List' suffix
       * (and connections to gain a 'Connection' suffix).
       */
      //pgOmitListSuffix: true,
      /*
       * Uncomment if you want 'userPatch' instead of 'patch' in update
       * mutations.
       */
      //pgSimplifyPatch: false,
      /*
       * Uncomment if you want 'allUsers' instead of 'users' at root level.
       */
      //pgSimplifyAllRows: false,
      /*
       * Uncomment if you want primary key queries and mutations to have
       * `ById` (or similar) suffix; and the `nodeId` queries/mutations
       * to lose their `ByNodeId` suffix.
       */
      // pgShortPk: true,
    },
    // ... other settings ...
  })
);
```

Roadmap
-------

* Add unit tests
* Provide a way to specify the prefix explicitly. This will allow using this plugin where multiple SQL schemas are specified.

---
_Source: https://npm.io/package/@cloudcycle/postgraphile-plugin-prefix-schema · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
