@tailor-platform/sdk 1.73.2 → 1.73.3

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.
@@ -254,6 +254,29 @@ type User {
254
254
  - `toward.as` - Customizes the field name for accessing the related type from this type
255
255
  - `backward` - Customizes the field name for accessing this type from the related type
256
256
 
257
+ Relation names share the same GraphQL field namespace as fields, files, and other relations on
258
+ the type. The SDK rejects duplicate or empty relation names. Use `toward.as` when multiple fields
259
+ on the same type point to the same target type, because their default forward names are derived
260
+ from the target type name:
261
+
262
+ ```typescript
263
+ const post = db.type("Post", {
264
+ authorID: db.uuid().relation({
265
+ type: "n-1",
266
+ toward: { type: user, as: "author" },
267
+ backward: "authoredPosts",
268
+ }),
269
+ reviewerID: db.uuid().relation({
270
+ type: "n-1",
271
+ toward: { type: user, as: "reviewer" },
272
+ backward: "reviewedPosts",
273
+ }),
274
+ });
275
+ ```
276
+
277
+ Use `toward.as` or `backward` when a generated relation name would conflict with an existing
278
+ field, files entry, or relation on the same type.
279
+
257
280
  ### Hooks
258
281
 
259
282
  Add hooks to execute functions during data creation or update. Hooks receive three arguments:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tailor-platform/sdk",
3
- "version": "1.73.2",
3
+ "version": "1.73.3",
4
4
  "description": "Tailor Platform SDK - The SDK to work with Tailor Platform",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,3 +0,0 @@
1
- import { n as generatePluginFilesIfNeeded, r as loadApplication, t as defineApplication } from "./application-Bb9NNp5m.mjs";
2
-
3
- export { defineApplication, generatePluginFilesIfNeeded };