grafeo-ogm 2.5.4 → 2.6.1
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/CHANGELOG.md +68 -0
- package/README.md +126 -1
- package/dist/cjs/compilers/fulltext.compiler.d.ts +17 -1
- package/dist/cjs/compilers/fulltext.compiler.d.ts.map +1 -1
- package/dist/cjs/compilers/fulltext.compiler.js +35 -3
- package/dist/cjs/compilers/fulltext.compiler.js.map +1 -1
- package/dist/cjs/compilers/mutation.compiler.d.ts +65 -2
- package/dist/cjs/compilers/mutation.compiler.d.ts.map +1 -1
- package/dist/cjs/compilers/mutation.compiler.js +249 -15
- package/dist/cjs/compilers/mutation.compiler.js.map +1 -1
- package/dist/cjs/compilers/selection.compiler.d.ts +65 -1
- package/dist/cjs/compilers/selection.compiler.d.ts.map +1 -1
- package/dist/cjs/compilers/selection.compiler.js +521 -25
- package/dist/cjs/compilers/selection.compiler.js.map +1 -1
- package/dist/cjs/compilers/where.compiler.d.ts +4 -0
- package/dist/cjs/compilers/where.compiler.d.ts.map +1 -1
- package/dist/cjs/compilers/where.compiler.js +23 -0
- package/dist/cjs/compilers/where.compiler.js.map +1 -1
- package/dist/cjs/interface-model.d.ts.map +1 -1
- package/dist/cjs/interface-model.js +8 -1
- package/dist/cjs/interface-model.js.map +1 -1
- package/dist/cjs/model.d.ts +33 -0
- package/dist/cjs/model.d.ts.map +1 -1
- package/dist/cjs/model.js +90 -11
- package/dist/cjs/model.js.map +1 -1
- package/dist/cjs/ogm.d.ts +14 -0
- package/dist/cjs/ogm.d.ts.map +1 -1
- package/dist/cjs/ogm.js +36 -2
- package/dist/cjs/ogm.js.map +1 -1
- package/dist/cjs/utils/strict-mode.d.ts +39 -0
- package/dist/cjs/utils/strict-mode.d.ts.map +1 -0
- package/dist/cjs/utils/strict-mode.js +59 -0
- package/dist/cjs/utils/strict-mode.js.map +1 -0
- package/dist/esm/compilers/fulltext.compiler.d.ts +17 -1
- package/dist/esm/compilers/fulltext.compiler.d.ts.map +1 -1
- package/dist/esm/compilers/fulltext.compiler.js +35 -3
- package/dist/esm/compilers/fulltext.compiler.js.map +1 -1
- package/dist/esm/compilers/mutation.compiler.d.ts +65 -2
- package/dist/esm/compilers/mutation.compiler.d.ts.map +1 -1
- package/dist/esm/compilers/mutation.compiler.js +249 -15
- package/dist/esm/compilers/mutation.compiler.js.map +1 -1
- package/dist/esm/compilers/selection.compiler.d.ts +65 -1
- package/dist/esm/compilers/selection.compiler.d.ts.map +1 -1
- package/dist/esm/compilers/selection.compiler.js +521 -25
- package/dist/esm/compilers/selection.compiler.js.map +1 -1
- package/dist/esm/compilers/where.compiler.d.ts +4 -0
- package/dist/esm/compilers/where.compiler.d.ts.map +1 -1
- package/dist/esm/compilers/where.compiler.js +23 -0
- package/dist/esm/compilers/where.compiler.js.map +1 -1
- package/dist/esm/interface-model.d.ts.map +1 -1
- package/dist/esm/interface-model.js +8 -1
- package/dist/esm/interface-model.js.map +1 -1
- package/dist/esm/model.d.ts +33 -0
- package/dist/esm/model.d.ts.map +1 -1
- package/dist/esm/model.js +91 -12
- package/dist/esm/model.js.map +1 -1
- package/dist/esm/ogm.d.ts +14 -0
- package/dist/esm/ogm.d.ts.map +1 -1
- package/dist/esm/ogm.js +36 -2
- package/dist/esm/ogm.js.map +1 -1
- package/dist/esm/utils/strict-mode.d.ts +39 -0
- package/dist/esm/utils/strict-mode.d.ts.map +1 -0
- package/dist/esm/utils/strict-mode.js +54 -0
- package/dist/esm/utils/strict-mode.js.map +1 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,73 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2.6.1 (2026-10-18) — security fixes
|
|
4
|
+
|
|
5
|
+
> **Security patch.** Fixes two authorization bypasses in node-level security, both present since policies were introduced: `upsert` ignored the `update` row filter on an existing node, and mutation responses returned nodes the context cannot read. Both affect **1.7.0–2.6.0**. OGMs without `policies` compile the same policy-free Cypher as before. Upgrade if you use `policies`.
|
|
6
|
+
|
|
7
|
+
### Security
|
|
8
|
+
|
|
9
|
+
- **`upsert` rewrote existing nodes the context could not update (high).** The MERGE put the `update` input in `ON MATCH SET` with no policy predicate. Only the update `WITH CHECK` restrictives ran, at the application layer. So a context for which a direct `update` matched 0 rows could still rewrite the node through `upsert`, including the owner field that the `update` policy keys on, and so take ownership of it. With `policies: { Chart: [permissive({ operations: ['update'], when: (c) => ({ ownerId: c.uid }) })] }`, user `u1` could run `Chart.upsert({ where: { id: 'c2' }, create: {…}, update: { ownerId: 'u1' } })` on a chart owned by `u2` and become its owner. The MERGE now applies the type's `update` row filter to the node it matches. That is the same clause a direct `update` puts in its `WHERE`: the applicable `update` permissives OR-ed (inherited interface policies included), and `false` when none applies. The update `WITH CHECK` still runs on the input. `createMany({ skipDuplicates: true, labels })` had the same gap in default mode: the runtime `labels` were `SET` on every existing node the MERGE matched. A matched node is now relabelled only when it passes the `update` row filter (a label change is an update, as `setLabels` enforces). Introduced with policies in 1.7.0 (`90ef75e`, v1.7.0-beta.0), where the upsert MERGE carried no row predicate.
|
|
10
|
+
- **Mutation responses returned nodes the context cannot read (medium).** `create`, `update` and `upsert` returned every node they wrote. Nested selections were filtered by their target types' `read` policies, but the root node was not. A context that could update a node, but whose `read` policy hid it, got the whole node back, including the fields `find` withholds. `update({ where: { id }, update: {} })` was enough to read it. A context that could create a node its read policy hides got it back the same way. The response projection now applies the root type's `read` policy to each node in its post-write state, just as `find` would filter it. Writes are unchanged: an `update` still needs only the `update` policy, as documented for nested writes. Present since 1.7.0, whose mutation projections passed the `read` bundle to nested selections only.
|
|
11
|
+
|
|
12
|
+
### Behavior change
|
|
13
|
+
|
|
14
|
+
- **`upsert` on an existing node** is now updated only when the node passes the type's `update` row filter. If it fails the filter, nothing is written (no update and no create) and `upsert` returns `null`, as a direct `update` that matches 0 rows returns no row. The create path (no node matches) is unchanged, and the matched node does not need to be readable, as with `update`. Under `policyDefaults: { onDeny: 'throw' }`, `upsert` still throws `PolicyDeniedError` before compile when no `update` permissive applies, as `update` does. **`createMany({ skipDuplicates: true, labels })`** in default mode no longer relabels existing nodes that fail the `update` row filter. It never throws for this, because the call is a create. Types without an `update` policy, overrides and bypasses compile the MERGE exactly as before.
|
|
15
|
+
- **Mutation responses** leave out every node the context cannot read after the write. It is missing from `create` / `update`'s `<plural>` array, and `upsert` returns `null`. The write still lands, and `info` counters still count it. Types without a `read` policy, overrides and bypasses compile exactly as before.
|
|
16
|
+
|
|
17
|
+
## 2.6.0 (2026-10-18) — strict mode
|
|
18
|
+
|
|
19
|
+
> **Minor release.** It adds an opt-in `strict` mode with the corrected behaviour for input shapes that 2.x compiles in surprising ways. **There are no behaviour changes without `strict`.** With `strict` unset or `false`, every input compiles to the same Cypher as in 2.5.4 and returns the same results. The one exception is the aggregate fix under Fixes, where a query that used to crash now returns `null` for the affected keys. Apart from that, the only difference is the deprecation warnings described below. Generated types are unchanged.
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
|
|
23
|
+
- **`new OGM({ …, strict: true })`.** A new optional `OGMConfig.strict` field. It defaults to `false` and **becomes the default in 3.0**. Strict mode switches on the corrected behaviour for every item under Deprecations: the shape either throws `OGMError` or compiles to what the input means. See the README "Strict mode" section.
|
|
24
|
+
- **Deprecation warnings.** With `strict` off, the OGM logs one `warn` through its `logger` the first time an instance meets each shape. Each is logged once per OGM instance and message key, so hot paths don't spam. Every warning has the form `[OGM] <problem> Enable \`strict: true\` (default in 3.0) to <fix>.`
|
|
25
|
+
|
|
26
|
+
### Notes
|
|
27
|
+
|
|
28
|
+
- **Default mode now logs one-time deprecation warnings** through the configured `logger` (`logger.warn`). This includes the construction-time warning for relationship fields that share a type and direction (Deprecations item 4), which fires in `new OGM(...)` without any query. Tests that assert `logger.warn` is never called may now see these warnings. Fix the flagged shape, or turn on `strict: true`. An OGM without a `logger`, or whose logger has no `warn`, logs nothing.
|
|
29
|
+
|
|
30
|
+
### Fixes
|
|
31
|
+
|
|
32
|
+
- **`aggregate` on a list field (`[Int]`, `[Float]`) failed the whole query.** It emitted `avg` / `sum` over a list, and the server rejected that (`AVG(...) can only handle numerical values, duration, or null`). In both modes, those keys now come back `null` and the rest of the aggregate works. The same applies to `InterfaceModel.aggregate`. Generated types are unchanged.
|
|
33
|
+
|
|
34
|
+
### Deprecations (the behaviour 3.0 flips; `strict: true` gives it now)
|
|
35
|
+
|
|
36
|
+
Each entry lists the 2.x behaviour, the warning you will see, and what `strict: true` does instead.
|
|
37
|
+
|
|
38
|
+
1. **Unknown keys in a connect / disconnect item are ignored.** A typo such as `{ wehre: … }` leaves the item with no filter: a connect links every target node, and a disconnect unlinks every related node.
|
|
39
|
+
- Warning: `Unknown key(s) "wehre" in a connect item on "pets" is ignored; with no "where", the item connects EVERY "Pet" node. Allowed: "where", "edge", "overwrite", "connect".` A disconnect gets the same warning, ending in `unlinks EVERY related "Pet" node` with allowed keys `"where", "disconnect"`.
|
|
40
|
+
- Strict: throws `OGMError`.
|
|
41
|
+
- Connect-all `[{}]` and the blanket disconnect `null` / `{}` are not affected.
|
|
42
|
+
2. **Unknown `edge` keys are stored as stray relationship properties.** This covers connect, nested create and nested update.
|
|
43
|
+
- Warning: `Unknown field "rolee" in the edge input of "posts" is not a property of the relationship properties type "Wrote"; it is written to the relationship as a stray property.`
|
|
44
|
+
- Strict: throws `Unknown field "rolee" in the edge input (…) of "posts" …`.
|
|
45
|
+
3. **`upsert` with several unique keys in `where` can create a duplicate.** MERGE matches all the keys together.
|
|
46
|
+
- Warning: `upsert on User with several unique keys in "where" ("id", "email") MERGEs on all of them together: a node that has one but not the others is not matched and a duplicate is created.`
|
|
47
|
+
- Strict: throws unless exactly one `@id` / `@unique` key is given.
|
|
48
|
+
4. **A blanket disconnect on a shared relationship type over-reaches.** With `pets: [Pet]` and `toys: [Toy]` both on `HAS`, `disconnect: { pets: null }` also unlinks the toys.
|
|
49
|
+
- Warning, logged once per field pair when the OGM is constructed: `User.pets (Pet) and User.toys (Toy) share relationship type "HAS" (OUT): a blanket disconnect (null / {}) on either also unlinks the other's nodes.`
|
|
50
|
+
- Strict: the blanket disconnect binds the field's own target label. For interface / union targets it binds the member labels.
|
|
51
|
+
5. **`labels` on `upsert` / `createMany({ skipDuplicates })` relabel matched existing nodes.**
|
|
52
|
+
- Warning: `"labels" on upsert (User) are added to every node the MERGE returns, so an existing node it matched is relabelled too.` The same warning is logged for `createMany with skipDuplicates`.
|
|
53
|
+
- Strict: the labels go in `ON CREATE SET`, so only newly created nodes get them.
|
|
54
|
+
6. **A fulltext `score` inside `OR` / `AND` / `NOT` is ignored.**
|
|
55
|
+
- Warning: `A fulltext \`score\` inside OR / AND / NOT (on Book) is ignored in 2.x: only a top-level fulltext entry's score filters results.`
|
|
56
|
+
- Strict: the threshold applies to its own branch.
|
|
57
|
+
7. **`@include` / `@skip` in a `selectionSet` are ignored.**
|
|
58
|
+
- Warning: `@include / @skip on "title" in a selectionSet is ignored in 2.x: the selection is always kept.`
|
|
59
|
+
- Strict: honoured for a literal `if: true | false`. A `$variable` or a missing or non-boolean `if` throws.
|
|
60
|
+
8. **`mode: 'insensitive'` does not apply to `_IN` / `_NOT_IN`.**
|
|
61
|
+
- Warning: `` `mode: 'insensitive'` does not apply to `title_IN`: _IN / _NOT_IN compare case-sensitively in 2.x. ``
|
|
62
|
+
- Strict: both sides are compared lowercased. This applies to String fields only.
|
|
63
|
+
9. **The same response key selected twice with different arguments keeps the first selection.**
|
|
64
|
+
- Warning: `The selectionSet selects "reviews" twice with different arguments; 2.x keeps the first selection and drops the second.`
|
|
65
|
+
- Strict: throws `Fields "reviews" conflict because they have differing arguments. Use different aliases on the fields to fetch both.`
|
|
66
|
+
- Only selections that can apply to the same object conflict. That is the case when either one is outside any fragment, or when their fragment types share a concrete type; interface and union conditions expand to their members. Fragments on disjoint types (`... on Dog { pals(where: A) }` and `... on Cat { pals(where: B) }`) are valid GraphQL: they never warn and never throw. In strict mode each type gets its own arguments; by default the first selection is used for both, as before.
|
|
67
|
+
10. **Differently aliased `edges`, `node` or `properties` in one connection keep only the first key.**
|
|
68
|
+
- Warning: `"reviewsConnection" selects \`edges\` under two response keys ("a", "b"); 2.x returns only "a", with both selections merged into it.` Inside one `edges`, the warning reads `"reviewsConnection" selects \`node\` under two response keys ("a", "b") in its edges; …` (likewise for `properties`).
|
|
69
|
+
- Strict: each key is returned with its own selection.
|
|
70
|
+
|
|
3
71
|
## 2.5.4 (2026-10-18) — security fix
|
|
4
72
|
|
|
5
73
|
> **Security patch.** Fixes an authorization bypass in node-level security for nodes that carry the labels of two or more implementers of the same interface or union. Affects **1.7.0–2.5.3** for `InterfaceModel` reads (`find`, `findFirst`, `findUnique`, `count`, `aggregate`) and **2.3.0–2.5.3** for interface / union relationship targets (nested selections, traversal filters, `connect` / `disconnect` and nested writes). OGMs without `policies` compile the same policy-free Cypher as before. Upgrade if you use `policies`.
|
package/README.md
CHANGED
|
@@ -31,6 +31,7 @@ Define your graph model once in `.graphql` and get fully typed CRUD operations,
|
|
|
31
31
|
- [Schema Definition](#schema-definition)
|
|
32
32
|
- [Query API](#query-api)
|
|
33
33
|
- [Mutation API](#mutation-api)
|
|
34
|
+
- [Strict mode](#strict-mode)
|
|
34
35
|
- [Advanced Features](#advanced-features)
|
|
35
36
|
- [Vector Search](#vector-search)
|
|
36
37
|
- [Type Generation](#type-generation)
|
|
@@ -183,6 +184,8 @@ const typeDefs = fs.readFileSync('./schema.graphql', 'utf-8');
|
|
|
183
184
|
const ogm = new OGM({ typeDefs, driver });
|
|
184
185
|
```
|
|
185
186
|
|
|
187
|
+
For new code, pass `strict: true` as well. It turns on the corrected behaviour for a handful of surprising input shapes and becomes the default in 3.0. See [Strict mode](#strict-mode).
|
|
188
|
+
|
|
186
189
|
### 4. Basic CRUD
|
|
187
190
|
|
|
188
191
|
```typescript
|
|
@@ -1006,6 +1009,126 @@ await Book.update({
|
|
|
1006
1009
|
|
|
1007
1010
|
---
|
|
1008
1011
|
|
|
1012
|
+
## Strict mode
|
|
1013
|
+
|
|
1014
|
+
```typescript
|
|
1015
|
+
const ogm = new OGM({ typeDefs, driver, logger, strict: true });
|
|
1016
|
+
```
|
|
1017
|
+
|
|
1018
|
+
Some input shapes compile to something other than what they say. A typo'd connect key widens the connect to every node. A fulltext `score` inside `OR` is ignored. Fixing these in place would change results that existing code may rely on, so 2.x keeps the old behaviour by default and adds an opt-in switch:
|
|
1019
|
+
|
|
1020
|
+
- **`strict` off (the 2.x default).** Every input compiles exactly as in v2.5.4, byte for byte (the one exception is the aggregate fix at the end of this section). The first time an OGM instance sees one of the shapes below, it logs one `warn` through `logger`, naming the problem and ending in "Enable `strict: true` (default in 3.0) to …". Each warning is logged once per OGM instance and shape, so hot paths don't spam the log.
|
|
1021
|
+
- **`strict: true`.** The corrected behaviour: the shape throws `OGMError` or compiles to what the input means. Strict mode never warns.
|
|
1022
|
+
- **3.0** makes `strict: true` the default. Turn it on now in new code, and use the warnings to find the call sites to fix in existing code.
|
|
1023
|
+
|
|
1024
|
+
Generated types are the same in both modes.
|
|
1025
|
+
|
|
1026
|
+
#### 1. Unknown keys in connect / disconnect items
|
|
1027
|
+
|
|
1028
|
+
A key the item is not compiled from is ignored, so a typo leaves the item with no filter.
|
|
1029
|
+
|
|
1030
|
+
```typescript
|
|
1031
|
+
await users.update({ where: { id }, connect: { pets: [{ wehre: { node: { id: petId } } }] } });
|
|
1032
|
+
// default: links EVERY Pet (and warns) · strict: OGMError: Unknown key(s) "wehre" in a connect item on "pets"
|
|
1033
|
+
```
|
|
1034
|
+
|
|
1035
|
+
Allowed keys: `where`, `edge`, `overwrite`, `connect` (connect) and `where`, `disconnect` (disconnect). Connect-all `[{}]` and the blanket disconnect `null` / `{}` are not affected.
|
|
1036
|
+
|
|
1037
|
+
#### 2. Unknown edge-property keys
|
|
1038
|
+
|
|
1039
|
+
```typescript
|
|
1040
|
+
await users.update({ where: { id }, connect: { posts: [{ where: { node: { id: postId } }, edge: { rolee: 'author' } }] } });
|
|
1041
|
+
// default: stores a stray `rolee` property on the relationship (and warns) · strict: OGMError: Unknown field "rolee" in the edge input …
|
|
1042
|
+
```
|
|
1043
|
+
|
|
1044
|
+
Applies to `edge` on connect, nested create and nested update.
|
|
1045
|
+
|
|
1046
|
+
#### 3. `upsert` with more than one unique key in `where`
|
|
1047
|
+
|
|
1048
|
+
```typescript
|
|
1049
|
+
await users.upsert({ where: { id: 'u2', email: 'a@x.com' }, create: {}, update: { name: 'A' } });
|
|
1050
|
+
// default: MERGE on {id, email} misses the existing node with that email → duplicate (and warns)
|
|
1051
|
+
// strict: OGMError: upsert "where" must name exactly one @id / @unique field
|
|
1052
|
+
```
|
|
1053
|
+
|
|
1054
|
+
#### 4. Blanket disconnect on a shared relationship type
|
|
1055
|
+
|
|
1056
|
+
```graphql
|
|
1057
|
+
type User @node {
|
|
1058
|
+
pets: [Pet!]! @relationship(type: "HAS", direction: OUT)
|
|
1059
|
+
toys: [Toy!]! @relationship(type: "HAS", direction: OUT)
|
|
1060
|
+
}
|
|
1061
|
+
```
|
|
1062
|
+
|
|
1063
|
+
```typescript
|
|
1064
|
+
await users.update({ where: { id }, disconnect: { pets: null } });
|
|
1065
|
+
// default: OPTIONAL MATCH (n)-[r:HAS]->() — unlinks the toys too (warned once when the OGM is built)
|
|
1066
|
+
// strict: OPTIONAL MATCH (n)-[r:HAS]->(:Pet) — only the pets
|
|
1067
|
+
```
|
|
1068
|
+
|
|
1069
|
+
Abstract targets are restricted to their members' labels.
|
|
1070
|
+
|
|
1071
|
+
#### 5. `labels` on `upsert` / `createMany({ skipDuplicates })`
|
|
1072
|
+
|
|
1073
|
+
```typescript
|
|
1074
|
+
await users.upsert({ where: { email }, create: {}, update: {}, labels: ['Vip'] });
|
|
1075
|
+
// default: SET n:Vip after the MERGE — an existing user it matched becomes Vip too (and warns)
|
|
1076
|
+
// strict: ON CREATE SET …, n:Vip — only a newly created user gets the label
|
|
1077
|
+
```
|
|
1078
|
+
|
|
1079
|
+
#### 6. Fulltext `score` inside `OR` / `AND` / `NOT`
|
|
1080
|
+
|
|
1081
|
+
```typescript
|
|
1082
|
+
await books.find({ fulltext: { OR: [{ BookTitle: { phrase: 'dune', score: 2 } }, { BookBody: { phrase: 'dune' } }] } });
|
|
1083
|
+
// default: the branch score is ignored (and warns) · strict: only BookTitle hits scoring ≥ 2 are kept from that branch
|
|
1084
|
+
```
|
|
1085
|
+
|
|
1086
|
+
#### 7. `@include` / `@skip` in a `selectionSet`
|
|
1087
|
+
|
|
1088
|
+
```typescript
|
|
1089
|
+
await books.find({ selectionSet: '{ id title @include(if: false) }' });
|
|
1090
|
+
// default: title is returned anyway (and warns) · strict: title is omitted
|
|
1091
|
+
```
|
|
1092
|
+
|
|
1093
|
+
Only a literal `if: true | false` is supported. `$variables` are still rejected.
|
|
1094
|
+
|
|
1095
|
+
#### 8. `mode: 'insensitive'` with `_IN` / `_NOT_IN`
|
|
1096
|
+
|
|
1097
|
+
```typescript
|
|
1098
|
+
await books.find({ where: { mode: 'insensitive', title_IN: ['DUNE'] } });
|
|
1099
|
+
// default: case-sensitive, misses "Dune" (and warns) · strict: toLower(n.title) IN [...lowered list], matches "Dune"
|
|
1100
|
+
```
|
|
1101
|
+
|
|
1102
|
+
String fields only. Other fields compare as-is in both modes.
|
|
1103
|
+
|
|
1104
|
+
#### 9. The same response key with different arguments
|
|
1105
|
+
|
|
1106
|
+
```typescript
|
|
1107
|
+
await books.find({ selectionSet: '{ reviews(where: { stars: 5 }) { id } reviews(where: { stars: 1 }) { body } }' });
|
|
1108
|
+
// default: the first selection wins, the second is dropped (and warns)
|
|
1109
|
+
// strict: OGMError: Fields "reviews" conflict because they have differing arguments. Use different aliases …
|
|
1110
|
+
```
|
|
1111
|
+
|
|
1112
|
+
Only selections that can apply to the same object conflict. Fragments on types that can never be the same node, such as `... on Dog { pals(where: A) { id } } ... on Cat { pals(where: B) { id } }`, are valid GraphQL. They never warn. In strict mode each type gets its own arguments; by default the first selection is used for both, as in 2.5.x.
|
|
1113
|
+
|
|
1114
|
+
#### 10. Differently aliased `edges`, `node` or `properties` in one connection
|
|
1115
|
+
|
|
1116
|
+
```typescript
|
|
1117
|
+
await books.find({ selectionSet: '{ reviewsConnection { a: edges { node { id } } b: edges { node { body } } } }' });
|
|
1118
|
+
// default: only `a`, holding both selections merged (and warns) · strict: `a` and `b`, each with its own selection
|
|
1119
|
+
|
|
1120
|
+
await books.find({ selectionSet: '{ reviewsConnection { edges { a: node { id } b: node { body } } } }' });
|
|
1121
|
+
// default: each edge has only `a: { id, body }` (and warns) · strict: `a: { id }` and `b: { body }`
|
|
1122
|
+
```
|
|
1123
|
+
|
|
1124
|
+
`properties` keys inside one `edges` work the same way.
|
|
1125
|
+
|
|
1126
|
+
#### Not behind the switch: `aggregate` on list fields
|
|
1127
|
+
|
|
1128
|
+
`avg` / `sum` on an `[Int]` / `[Float]` field made the server reject the whole aggregate query. Since 2.6.0, in both modes, those keys come back `null` and the rest of the aggregate works: `{ scores: { min, max, average: null, sum: null } }`.
|
|
1129
|
+
|
|
1130
|
+
---
|
|
1131
|
+
|
|
1009
1132
|
## Advanced Features
|
|
1010
1133
|
|
|
1011
1134
|
### Fulltext Search
|
|
@@ -1403,6 +1526,8 @@ Writes follow one principle: **a nested write enforces exactly what the equivale
|
|
|
1403
1526
|
|
|
1404
1527
|
Write restrictives and create default-deny are checked before the query runs, so a rejected nested write throws `PolicyDeniedError` and nothing is written.
|
|
1405
1528
|
|
|
1529
|
+
**Mutation responses are reads.** The nodes that `create`, `update` and `upsert` return are filtered by the root type's `read` policy, checked against the node as it is after the write, just as `find` would filter them. A write to a node the context may update or create but not read still happens, but that node is left out of the response: it is missing from the `<plural>` array, and `upsert` returns `null`. The `info` counters still count it. Nested selections in the response were already filtered by their own target-type policies. Before v2.6.1 the root node came back in full, including fields its `read` policy hides.
|
|
1530
|
+
|
|
1406
1531
|
> **A type without policies is open, but not a gateway.** Before v2.3.0, reading or writing through a type with no policies of its own skipped the policies of the types beyond it, and nested writes enforced no target-type policy at all. If a nested write into a protected type now gets filtered or denied, add the matching policy for that operation on the target type, or perform the write directly on its model.
|
|
1407
1532
|
|
|
1408
1533
|
#### Enforcement boundary
|
|
@@ -1491,7 +1616,7 @@ How it works:
|
|
|
1491
1616
|
#### Limitations
|
|
1492
1617
|
|
|
1493
1618
|
- **`@cypher` scalar fields inside a policy `where`-partial throw when the policy is injected into nested-selection enforcement.** Refactor the policy to use stored properties or a relationship traversal.
|
|
1494
|
-
- **`upsert`**
|
|
1619
|
+
- **`upsert`** enforces exactly what the equivalent direct calls would. When no node matches the `where`, it creates one under the `create` policy (default-deny and `WITH CHECK`). When a node matches, the type's `update` row filter applies to it, the same clause a direct `update` puts in its `WHERE`: the node is updated only if it passes, and if it fails nothing is written and `upsert` returns `null`, just as a direct `update` matches 0 rows. The update input is also checked against the update `WITH CHECK`. As with `update`, the matched node does not have to be readable. With `skipDuplicates`, `createMany` adds default-mode `labels` to an existing node it matches only if that node passes the `update` row filter. Before v2.6.1 only the `WITH CHECK` ran, so `upsert` could rewrite any existing node, including the owner field the update policy keys on.
|
|
1495
1620
|
- **Restrictives are split into read-side and write-side flavors.** A restrictive's `operations` array determines which `when` signature applies. Read-side ops (`read|delete|aggregate|count`) → `when(ctx)` returns a where-partial or boolean. Write-side ops (`create|update`) → `when(ctx, input)` returns a boolean only. Mixed arrays (e.g. `['read', 'create']`) are rejected at construction time — split into two restrictives. Each flavor is invoked exactly once per query (read-side at compile, write-side at the application layer). Use `isReadRestrictive` / `isWriteRestrictive` if you need to inspect a policy at runtime.
|
|
1496
1621
|
- **InterfaceModel branches.** Each implementer's `CASE` branch is exactly the policy clause that implementer's own model enforces, including the interface-level policies it inherits. An implementer with no policies of its own therefore gets only the interface-level ones. The OGM emits a `logger.warn` at construction time when an interface has policies and one of its implementers does not. Silence it by registering an explicit policy on each implementer.
|
|
1497
1622
|
- **`edge` filters in nested-write `where`** (connect, disconnect, nested update and delete) are not supported and throw.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FulltextInput } from '../model';
|
|
2
2
|
import { FulltextIndex, NodeDefinition, SchemaMetadata } from '../schema/types';
|
|
3
|
+
import { StrictMode } from '../utils/strict-mode';
|
|
3
4
|
export interface FulltextResult {
|
|
4
5
|
cypher: string;
|
|
5
6
|
params: Record<string, unknown>;
|
|
@@ -18,7 +19,11 @@ export interface FulltextResult {
|
|
|
18
19
|
*/
|
|
19
20
|
export declare class FulltextCompiler {
|
|
20
21
|
private schema;
|
|
21
|
-
|
|
22
|
+
/** v2.6.0 — strict mode + warn-once log, shared per OGM. */
|
|
23
|
+
private strictMode;
|
|
24
|
+
constructor(schema: SchemaMetadata,
|
|
25
|
+
/** v2.6.0 — strict mode + warn-once log, shared per OGM. */
|
|
26
|
+
strictMode?: StrictMode);
|
|
22
27
|
/**
|
|
23
28
|
* Compile fulltext input to Cypher CALL clause(s).
|
|
24
29
|
* Handles flat leaves AND recursive OR/AND/NOT expressions.
|
|
@@ -33,6 +38,17 @@ export declare class FulltextCompiler {
|
|
|
33
38
|
score?: number;
|
|
34
39
|
}>, relIndex: FulltextIndex, relVar?: string): FulltextResult;
|
|
35
40
|
private compileNode;
|
|
41
|
+
/**
|
|
42
|
+
* v2.6.0 — a leaf with a `score` inside `OR` / `AND` / `NOT`. Only a
|
|
43
|
+
* top-level leaf's threshold reaches the caller's `WHERE score >= …`;
|
|
44
|
+
* inside an operator the bound `ft_score_<n>` was never referenced, so
|
|
45
|
+
* the threshold was ignored (and a single-branch operator, which hands
|
|
46
|
+
* the leaf's threshold up un-renamed, referenced a missing `$ft_score`).
|
|
47
|
+
* Default: unchanged, with a warning. Strict: the branch filters its
|
|
48
|
+
* own rows (`… WHERE score >= $ft_score_<n>`) and the threshold
|
|
49
|
+
* is consumed here.
|
|
50
|
+
*/
|
|
51
|
+
private branchScore;
|
|
36
52
|
/**
|
|
37
53
|
* Compile a leaf entry. Two shapes:
|
|
38
54
|
* - Node index: `{ IndexName: { phrase, score? } }` — value has `phrase`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fulltext.compiler.d.ts","sourceRoot":"","sources":["../../../src/compilers/fulltext.compiler.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EAEd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"fulltext.compiler.d.ts","sourceRoot":"","sources":["../../../src/compilers/fulltext.compiler.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,aAAa,EAEd,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAqB,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAkCrE,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;GAUG;AACH,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,MAAM;IACd,4DAA4D;IAC5D,OAAO,CAAC,UAAU;gBAFV,MAAM,EAAE,cAAc;IAC9B,4DAA4D;IACpD,UAAU,GAAE,UAAgC;IAGtD;;;OAGG;IACH,OAAO,CACL,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,cAAc,EACvB,OAAO,SAAM,GACZ,cAAc;IAqBjB;;;OAGG;IACH,mBAAmB,CACjB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,EAC5D,QAAQ,EAAE,aAAa,EACvB,MAAM,SAAM,GACX,cAAc;IAgDjB,OAAO,CAAC,WAAW;IAuDnB;;;;;;;;;OASG;IACH,OAAO,CAAC,WAAW;IA0BnB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAqCnB,+EAA+E;IAC/E,OAAO,CAAC,gBAAgB;IAoCxB;;;;;;OAMG;IACH,OAAO,CAAC,wBAAwB;IAoFhC;;OAEG;IACH,OAAO,CAAC,SAAS;IAiDjB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,UAAU;IAiElB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,UAAU;IAiClB;;;;;;;OAOG;IACH,OAAO,CAAC,YAAY;CAiBrB"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FulltextCompiler = void 0;
|
|
4
4
|
const errors_1 = require("../errors");
|
|
5
5
|
const model_1 = require("../model");
|
|
6
|
+
const strict_mode_1 = require("../utils/strict-mode");
|
|
6
7
|
const validation_1 = require("../utils/validation");
|
|
7
8
|
/** Maximum recursion depth for nested fulltext logical operators */
|
|
8
9
|
const MAX_DEPTH = 10;
|
|
@@ -35,8 +36,11 @@ function assertValidFulltextPhrase(phrase) {
|
|
|
35
36
|
* - **NOT**: `WHERE NOT EXISTS { ... }` exclusion pattern (Neo4j 5+)
|
|
36
37
|
*/
|
|
37
38
|
class FulltextCompiler {
|
|
38
|
-
constructor(schema
|
|
39
|
+
constructor(schema,
|
|
40
|
+
/** v2.6.0 — strict mode + warn-once log, shared per OGM. */
|
|
41
|
+
strictMode = (0, strict_mode_1.lenientStrictMode)()) {
|
|
39
42
|
this.schema = schema;
|
|
43
|
+
this.strictMode = strictMode;
|
|
40
44
|
}
|
|
41
45
|
/**
|
|
42
46
|
* Compile fulltext input to Cypher CALL clause(s).
|
|
@@ -107,8 +111,12 @@ class FulltextCompiler {
|
|
|
107
111
|
// The operator dispatch below returns on its first hit, so anything
|
|
108
112
|
// alongside OR / AND / NOT would be dropped without a word.
|
|
109
113
|
(0, validation_1.assertSingleFulltextOperator)(Object.keys(input));
|
|
110
|
-
if ((0, model_1.isFulltextLeaf)(input))
|
|
111
|
-
|
|
114
|
+
if ((0, model_1.isFulltextLeaf)(input)) {
|
|
115
|
+
const leaf = this.compileLeaf(input, nodeDef, nodeVar, paramCounter);
|
|
116
|
+
if (depth > 0 && leaf.scoreThreshold !== undefined)
|
|
117
|
+
return this.branchScore(leaf, nodeDef, nodeVar);
|
|
118
|
+
return leaf;
|
|
119
|
+
}
|
|
112
120
|
if ('OR' in input)
|
|
113
121
|
return this.compileOr(input.OR, nodeDef, nodeVar, paramCounter, depth + 1);
|
|
114
122
|
if ('AND' in input)
|
|
@@ -117,6 +125,30 @@ class FulltextCompiler {
|
|
|
117
125
|
return this.compileNot(input.NOT, nodeDef, nodeVar, paramCounter, depth + 1);
|
|
118
126
|
throw new errors_1.OGMError('Invalid fulltext input: must be a leaf, OR, AND, or NOT');
|
|
119
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* v2.6.0 — a leaf with a `score` inside `OR` / `AND` / `NOT`. Only a
|
|
130
|
+
* top-level leaf's threshold reaches the caller's `WHERE score >= …`;
|
|
131
|
+
* inside an operator the bound `ft_score_<n>` was never referenced, so
|
|
132
|
+
* the threshold was ignored (and a single-branch operator, which hands
|
|
133
|
+
* the leaf's threshold up un-renamed, referenced a missing `$ft_score`).
|
|
134
|
+
* Default: unchanged, with a warning. Strict: the branch filters its
|
|
135
|
+
* own rows (`… WHERE score >= $ft_score_<n>`) and the threshold
|
|
136
|
+
* is consumed here.
|
|
137
|
+
*/
|
|
138
|
+
branchScore(leaf, nodeDef, nodeVar) {
|
|
139
|
+
if (!this.strictMode.strict) {
|
|
140
|
+
this.strictMode.warn('fulltext-branch-score', nodeDef.typeName, `A fulltext \`score\` inside OR / AND / NOT (on ${nodeDef.typeName}) is ignored in 2.x: ` +
|
|
141
|
+
`only a top-level fulltext entry's score filters results.`, 'apply the score threshold to its own branch');
|
|
142
|
+
return leaf;
|
|
143
|
+
}
|
|
144
|
+
const scoreParam = Object.keys(leaf.params).find((k) => k.startsWith('ft_score_'));
|
|
145
|
+
return {
|
|
146
|
+
// The trailing WITH lets any clause follow — a single-branch operator
|
|
147
|
+
// hands this leaf straight to the caller, which appends its WHERE.
|
|
148
|
+
cypher: `${leaf.cypher}\nWHERE score >= $${scoreParam}\nWITH ${nodeVar}, score`,
|
|
149
|
+
params: leaf.params,
|
|
150
|
+
};
|
|
151
|
+
}
|
|
120
152
|
/**
|
|
121
153
|
* Compile a leaf entry. Two shapes:
|
|
122
154
|
* - Node index: `{ IndexName: { phrase, score? } }` — value has `phrase`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fulltext.compiler.js","sourceRoot":"","sources":["../../../src/compilers/fulltext.compiler.ts"],"names":[],"mappings":";;;AAAA,sCAAqC;AACrC,oCAKkB;AAElB,oDAO6B;AAE7B,oEAAoE;AACpE,MAAM,SAAS,GAAG,EAAE,CAAC;AAErB;;;;;;;;GAQG;AACH,MAAM,0BAA0B,GAAG,CAAC,GAAG,IAAI,CAAC;AAE5C,SAAS,yBAAyB,CAAC,MAAe;IAChD,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC;QAC1D,MAAM,IAAI,iBAAQ,CAAC,mCAAmC,CAAC,CAAC;IAC1D,IAAI,MAAM,CAAC,MAAM,GAAG,0BAA0B;QAC5C,MAAM,IAAI,iBAAQ,CAChB,iDAAiD,0BAA0B,cAAc;YACvF,QAAQ,MAAM,CAAC,MAAM,kDAAkD,CAC1E,CAAC;AACN,CAAC;AAQD;;;;;;;;;;GAUG;AACH,MAAa,gBAAgB;IAC3B,YAAoB,MAAsB;QAAtB,WAAM,GAAN,MAAM,CAAgB;IAAG,CAAC;IAE9C;;;OAGG;IACH,OAAO,CACL,QAAuB,EACvB,OAAuB,EACvB,OAAO,GAAG,GAAG;QAEb,IAAA,iCAAoB,EAAC,OAAO,EAAE,eAAe,CAAC,CAAC;QAC/C,MAAM,YAAY,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;QAClC,MAAM,MA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AE,SAAS,EAAE,CAAC;IACvC,CAAC;IAED;;;;;;;OAOG;IACK,YAAY,CAClB,YAAoB,EACpB,SAAiB,EACjB,OAAe,EACf,GAAW;QAEX,MAAM,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC;QAC1B,MAAM,CAAC,GAAG,QAAQ,GAAG,IAAI,CAAC;QAC1B,OAAO;YACL,UAAU;YACV,OAAO,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;YAChD,cAAc,SAAS,OAAO,CAAC,cAAc,CAAC,EAAE;YAChD,KAAK;YACL,UAAU,OAAO,KAAK,CAAC,KAAK,CAAC,EAAE;YAC/B,WAAW,CAAC,MAAM,OAAO,EAAE;SAC5B,CAAC;IACJ,CAAC;CACF;AAviBD,4CAuiBC"}
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import type { OGMLogger } from '../execution/executor';
|
|
2
2
|
import type { PolicyContextBundle } from '../policy/types';
|
|
3
3
|
import { NodeDefinition, SchemaMetadata } from '../schema/types';
|
|
4
|
+
import { StrictMode } from '../utils/strict-mode';
|
|
4
5
|
import { WhereCompiler } from './where.compiler';
|
|
5
6
|
export interface MutationResult {
|
|
6
7
|
cypher: string;
|
|
7
8
|
params: Record<string, unknown>;
|
|
8
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* v2.6.1 — a row filter on `n` that gates the MATCH side of a MERGE (the
|
|
12
|
+
* root type's `update` policy, compiled by `WhereCompiler.compile`). An
|
|
13
|
+
* empty `cypher` means "no filter" and leaves the emitted Cypher unchanged.
|
|
14
|
+
*/
|
|
15
|
+
export interface MatchGuard {
|
|
16
|
+
cypher: string;
|
|
17
|
+
params: Record<string, unknown>;
|
|
18
|
+
preludes?: string[];
|
|
19
|
+
}
|
|
9
20
|
/**
|
|
10
21
|
* Compiles create, update, delete, and label mutations into Cypher + params.
|
|
11
22
|
*/
|
|
@@ -25,9 +36,12 @@ export declare class MutationCompiler {
|
|
|
25
36
|
* lazily constructed with default options otherwise.
|
|
26
37
|
*/
|
|
27
38
|
private policyWhereCompiler?;
|
|
39
|
+
/** v2.6.0 — strict mode + warn-once log, shared per OGM. */
|
|
40
|
+
private strictMode;
|
|
28
41
|
constructor(schema: SchemaMetadata, options?: {
|
|
29
42
|
logger?: OGMLogger;
|
|
30
43
|
whereCompiler?: WhereCompiler;
|
|
44
|
+
strictMode?: StrictMode;
|
|
31
45
|
});
|
|
32
46
|
/**
|
|
33
47
|
* Resolve and compile the TARGET type's `read` policy predicate for a
|
|
@@ -116,6 +130,28 @@ export declare class MutationCompiler {
|
|
|
116
130
|
* target is unknown — pre-2.4.8 the nested op was silently skipped.
|
|
117
131
|
*/
|
|
118
132
|
private requireTargetDef;
|
|
133
|
+
/**
|
|
134
|
+
* v2.6.0 — keys of a connect / disconnect item that the compiler does not
|
|
135
|
+
* read. Pre-2.6.0 (and still by default) they are ignored, so a typo such
|
|
136
|
+
* as `{ wehre: … }` compiles to an item with NO filter: a connect links
|
|
137
|
+
* every target node, a disconnect unlinks every related one. Default: one
|
|
138
|
+
* warning per OGM; strict: `OGMError`, like an unknown write field.
|
|
139
|
+
*/
|
|
140
|
+
private checkLinkItemKeys;
|
|
141
|
+
/**
|
|
142
|
+
* v2.6.0 — `labels` on a MERGE path (upsert, createMany with
|
|
143
|
+
* skipDuplicates) are SET after the MERGE, so they are also added to an
|
|
144
|
+
* EXISTING node it matched. Default: unchanged, one warning; strict: the
|
|
145
|
+
* labels go in `ON CREATE SET`, onto newly created nodes only.
|
|
146
|
+
*/
|
|
147
|
+
private labelsOnMatchedNodes;
|
|
148
|
+
/**
|
|
149
|
+
* v2.6.0 — `edge` keys that are not properties of the relationship's
|
|
150
|
+
* `@relationshipProperties` type. Pre-2.6.0 (and still by default) each
|
|
151
|
+
* is written to the relationship as a stray property. Default: one
|
|
152
|
+
* warning per OGM; strict: `OGMError` (`Unknown field …`).
|
|
153
|
+
*/
|
|
154
|
+
private checkEdgeKeys;
|
|
119
155
|
/**
|
|
120
156
|
* Generate CREATE Cypher for one or more nodes.
|
|
121
157
|
* Handles scalar properties, nested relationship creates, and connects.
|
|
@@ -202,8 +238,14 @@ export declare class MutationCompiler {
|
|
|
202
238
|
/**
|
|
203
239
|
* Generate MERGE (upsert) Cypher with ON CREATE SET / ON MATCH SET.
|
|
204
240
|
* Scalar properties only — nested relationship ops are not supported.
|
|
241
|
+
*
|
|
242
|
+
* v2.6.1 — `updateGuard` is the root type's `update` row filter on `n`
|
|
243
|
+
* (compiled by the caller with `preserveVars: ['__matched']`). When it
|
|
244
|
+
* is non-empty, an EXISTING node is updated only when it passes the
|
|
245
|
+
* guard, exactly like a direct `update`; one that fails it is left
|
|
246
|
+
* untouched and no row is returned. See `buildGuardedMerge`.
|
|
205
247
|
*/
|
|
206
|
-
compileMerge(where: Record<string, unknown>, create: Record<string, unknown>, update: Record<string, unknown>, nodeDef: NodeDefinition, labels?: string[]): MutationResult;
|
|
248
|
+
compileMerge(where: Record<string, unknown>, create: Record<string, unknown>, update: Record<string, unknown>, nodeDef: NodeDefinition, labels?: string[], updateGuard?: MatchGuard): MutationResult;
|
|
207
249
|
/**
|
|
208
250
|
* Generate SET/REMOVE labels Cypher.
|
|
209
251
|
*/
|
|
@@ -217,7 +259,15 @@ export declare class MutationCompiler {
|
|
|
217
259
|
* Scalar properties only — no nested relationship operations.
|
|
218
260
|
* Returns count of created nodes.
|
|
219
261
|
*/
|
|
220
|
-
compileCreateMany(data: Record<string, unknown>[], nodeDef: NodeDefinition, skipDuplicates?: boolean, labels?: string[]
|
|
262
|
+
compileCreateMany(data: Record<string, unknown>[], nodeDef: NodeDefinition, skipDuplicates?: boolean, labels?: string[],
|
|
263
|
+
/**
|
|
264
|
+
* v2.6.1 — the root type's `update` row filter on `n`. With
|
|
265
|
+
* `skipDuplicates` and default-mode `labels`, an EXISTING node the
|
|
266
|
+
* MERGE matched is relabelled only when it passes this guard (a label
|
|
267
|
+
* change is an update, as `setLabels` enforces); created nodes get the
|
|
268
|
+
* labels in `ON CREATE SET`.
|
|
269
|
+
*/
|
|
270
|
+
updateGuard?: MatchGuard): MutationResult;
|
|
221
271
|
/**
|
|
222
272
|
* Resolve the PropertyDefinition of an edge (relationship) property so
|
|
223
273
|
* Int/BigInt edge writes get the same Integer coercion as node writes.
|
|
@@ -288,6 +338,19 @@ export declare class MutationCompiler {
|
|
|
288
338
|
*/
|
|
289
339
|
private narrowedRelDefs;
|
|
290
340
|
private narrowToMember;
|
|
341
|
+
/**
|
|
342
|
+
* v2.6.0 — how a blanket disconnect (`null` / `{}`) restricts its target.
|
|
343
|
+
*
|
|
344
|
+
* Default (v2.5.3): only a relationship narrowed to a union / interface
|
|
345
|
+
* member keeps that member's label; otherwise the target is anonymous,
|
|
346
|
+
* so with two fields on one relationship type and direction
|
|
347
|
+
* (`pets: [Pet]`, `toys: [Toy]`, both `HAS`) a blanket disconnect of one
|
|
348
|
+
* also unlinks the other's nodes (warned once at OGM construction).
|
|
349
|
+
*
|
|
350
|
+
* Strict: the field's own target type — its label, or for an abstract
|
|
351
|
+
* target a predicate over its members' labels on `targetVar`.
|
|
352
|
+
*/
|
|
353
|
+
private blanketRestriction;
|
|
291
354
|
/** The label a blanket disconnect over `relDef` must keep (see above). */
|
|
292
355
|
private blanketTargetLabel;
|
|
293
356
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation.compiler.d.ts","sourceRoot":"","sources":["../../../src/compilers/mutation.compiler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EACL,cAAc,EAGd,cAAc,EACf,MAAM,iBAAiB,CAAC;AAqBzB,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EA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