SeedCompany / cord-api-v3

Bible translation project management API
MIT License
18 stars 4 forks source link

[EdgeDB] Default Repo create/update handle link IDs #3097

Closed CarsonF closed 8 months ago

CarsonF commented 8 months ago

The queries built will now automatically cast IDs for links to their object refs. The methods will also accept props with an Id suffix and strip it off.

This should help make a lot of our queries involving links easier, as demonstrated by FieldZone & FieldRegion repos.

  create({
    name: input.name,
-   director: e.cast(e.User, e.cast(e.uuid, input.directorId)),
+   directorId: input.directorId,
  })

This is only a shortcut: EdgeQL expressions can still be given, and IDs can be given to director (no Id suffix).

┆Issue is synchronized with this Monday item by Unito