@coderich/autograph 0.10.23 → 0.10.25
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 +41 -0
- package/package.json +1 -1
- package/src/.DS_Store +0 -0
- package/src/core/.DS_Store +0 -0
- package/src/core/EventEmitter.js +4 -4
- package/src/data/.DS_Store +0 -0
- package/src/driver/.DS_Store +0 -0
- package/src/graphql/.DS_Store +0 -0
- package/src/graphql/ast/.DS_Store +0 -0
- package/src/graphql/extension/.DS_Store +0 -0
- package/src/query/.DS_Store +0 -0
- package/src/query/QueryResolver.js +7 -1
- package/src/service/.DS_Store +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# CHANGELOG
|
|
2
|
+
|
|
3
|
+
## v0.10.x
|
|
4
|
+
- Replaced ResultSet -> POJOs
|
|
5
|
+
- Removed all $field methods (auto populated)
|
|
6
|
+
- Removed .toObject()
|
|
7
|
+
- $model $save remove $delete $lookup $cursor $pageInfo
|
|
8
|
+
- Removed embedded API completely
|
|
9
|
+
- Removed Directives
|
|
10
|
+
- embedApi -> no replacement
|
|
11
|
+
- enforce -> use pipeline methods
|
|
12
|
+
- resolve -> use graphql resolvers
|
|
13
|
+
- @value -> use @field.instruct directive
|
|
14
|
+
- Removed Model.tform() -> use Model.shapeObject(shape, data)
|
|
15
|
+
- Removed Transformer + Rule -> use Pipeline
|
|
16
|
+
- Removed many pre-defined rules + transformers
|
|
17
|
+
- Moved "validator" to dev dependency -> isEmail
|
|
18
|
+
- Added QueryBuilder.resolve() terminal command
|
|
19
|
+
- Exported SchemaDecorator -> Schema
|
|
20
|
+
- Removed embedded schema SystemEvents (internal emitter also removed)
|
|
21
|
+
- Removed spread of arguments in QueryBuilder terminal commands (must pass in array)
|
|
22
|
+
- Mutate "merged" instead of "input"
|
|
23
|
+
- Validate "payload"
|
|
24
|
+
|
|
25
|
+
## v0.9.x
|
|
26
|
+
- Subscriptions API
|
|
27
|
+
- postMutation no longer mutates "doc" and adds "result"
|
|
28
|
+
- Added onDelete defer option
|
|
29
|
+
|
|
30
|
+
## v0.8.x
|
|
31
|
+
- Engine 14+
|
|
32
|
+
|
|
33
|
+
## v0.7.x
|
|
34
|
+
- Complete overhaul of Query to Mongo Driver (pagination, sorting, counts, etc)
|
|
35
|
+
- Removed countModel Queries from the API (now available as `count` property on `Connetion` types)
|
|
36
|
+
- Dropped Neo4J (temporarily)
|
|
37
|
+
|
|
38
|
+
## v0.6.x
|
|
39
|
+
- Mongo driver no longer checks for `version` directive
|
|
40
|
+
- Models no longer share a Connection type; removing the need to use `... on Model` for GraphQL queries
|
|
41
|
+
- Added `@field(connection: Boolean)` parameter to specifically indicate fields that should return a Connection type
|
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
package/src/core/EventEmitter.js
CHANGED
|
@@ -31,8 +31,8 @@ module.exports = class extends EventEmitter {
|
|
|
31
31
|
const { key } = event;
|
|
32
32
|
|
|
33
33
|
if (ensureArray(keys).indexOf(key) > -1) {
|
|
34
|
-
await fn(event, next);
|
|
35
34
|
if (numArgs < 2) next();
|
|
35
|
+
await fn(event, next);
|
|
36
36
|
} else {
|
|
37
37
|
next();
|
|
38
38
|
}
|
|
@@ -49,8 +49,8 @@ module.exports = class extends EventEmitter {
|
|
|
49
49
|
const { key } = event;
|
|
50
50
|
|
|
51
51
|
if (ensureArray(keys).indexOf(key) > -1) {
|
|
52
|
-
await fn(event, next);
|
|
53
52
|
if (numArgs < 2) next();
|
|
53
|
+
await fn(event, next);
|
|
54
54
|
} else {
|
|
55
55
|
next();
|
|
56
56
|
}
|
|
@@ -67,8 +67,8 @@ module.exports = class extends EventEmitter {
|
|
|
67
67
|
const { model } = event;
|
|
68
68
|
|
|
69
69
|
if (ensureArray(models).indexOf(`${model}`) > -1) {
|
|
70
|
-
await fn(event, next);
|
|
71
70
|
if (numArgs < 2) next();
|
|
71
|
+
await fn(event, next);
|
|
72
72
|
} else {
|
|
73
73
|
next();
|
|
74
74
|
}
|
|
@@ -85,8 +85,8 @@ module.exports = class extends EventEmitter {
|
|
|
85
85
|
const { model } = event;
|
|
86
86
|
|
|
87
87
|
if (ensureArray(models).indexOf(`${model}`) > -1) {
|
|
88
|
-
await fn(event, next);
|
|
89
88
|
if (numArgs < 2) next();
|
|
89
|
+
await fn(event, next);
|
|
90
90
|
} else {
|
|
91
91
|
next();
|
|
92
92
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -82,11 +82,17 @@ module.exports = class QueryResolver {
|
|
|
82
82
|
|
|
83
83
|
return this.resolver.match(model).match(match).one({ required: true }).then((doc) => {
|
|
84
84
|
const merged = mergeDeep(doc, input);
|
|
85
|
+
const docHash = hashObject(doc);
|
|
86
|
+
const skipUnchanged = get(flags, 'skipUnchanged');
|
|
85
87
|
|
|
86
88
|
// Prevent udpates when no data has changed
|
|
87
|
-
if (
|
|
89
|
+
if (skipUnchanged && docHash === hashObject(merged)) return doc;
|
|
88
90
|
|
|
89
91
|
return createSystemEvent('Mutation', { query: query.doc(doc).merged(merged) }, async () => {
|
|
92
|
+
// Prevent udpates when no data has changed (because merged can be mutated)
|
|
93
|
+
if (skipUnchanged && docHash === hashObject(merged)) return doc;
|
|
94
|
+
|
|
95
|
+
// Process
|
|
90
96
|
const payload = model.shapeObject(inputShape, merged, query);
|
|
91
97
|
await model.validateObject(inputShape, payload, query.payload(payload));
|
|
92
98
|
const $doc = model.shapeObject(docShape, payload, query, undefined, undefined, true);
|
|
Binary file
|