@stonecrop/graphql-middleware 0.24.0 → 0.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,6 +28,12 @@ const preset: GraphileConfig.Preset = {
28
28
  }
29
29
  ```
30
30
 
31
+ `createStonecropPreset()` makes two corrections to the schema PostGraphile would otherwise build.
32
+ It moves Relay's global identifier to `nodeId` so a real `id` column keeps its own name, and it
33
+ exposes the many side of any foreign key declared `ON DELETE CASCADE` — so a parent type carries a
34
+ collection field for the rows it owns, and `stonecrop-schema generate` can turn that into a child
35
+ table. A foreign key without a cascade is a reference, not ownership, and stays one-directional.
36
+
31
37
  `createStonecropPlugin()` discovers the `PgExecutor` automatically from `pgServices` — no executor argument is needed. An optional `StonecropPluginOptions` object accepts:
32
38
 
33
39
  | Option | Default | Description |
@@ -376,7 +376,9 @@ export declare interface StonecropPluginOptions {
376
376
  * Override the PostgreSQL FROM clause target for specific doctypes, keyed by doctype name.
377
377
  * Values may be a bare table name (`'plan'`) or a schema-qualified name (`'orpin.plan'`).
378
378
  * SQL fragments and subqueries are not supported.
379
- * When absent for a doctype, the table name is derived as `camelToSnake(doctype.name)`.
379
+ * When absent for a doctype, the table name is derived as `pascalToSnake(doctype.name)`, so
380
+ * `SalesOrder` becomes `sales_order`. (Not `camelToSnake`, which prefixes a leading underscore on a
381
+ * PascalCase name: `camelToSnake('User')` is `_user`.)
380
382
  */
381
383
  tables?: Record<string, string>;
382
384
  /**