directus 9.18.0 → 9.18.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.
@@ -279,12 +279,18 @@ class GraphQLService {
279
279
  // can't non-null in update, as that would require every not-nullable field to be
280
280
  // submitted on updates
281
281
  if (field.nullable === false &&
282
+ !field.defaultValue &&
282
283
  !constants_1.GENERATE_SPECIAL.some((flag) => field.special.includes(flag)) &&
283
284
  action !== 'update') {
284
285
  type = (0, graphql_1.GraphQLNonNull)(type);
285
286
  }
286
287
  if (collection.primary === field.field) {
287
- type = (0, graphql_1.GraphQLNonNull)(graphql_1.GraphQLID);
288
+ if (!field.defaultValue && !field.special.includes('uuid') && action === 'create')
289
+ type = (0, graphql_1.GraphQLNonNull)(graphql_1.GraphQLID);
290
+ else if (['create', 'update'].includes(action))
291
+ type = graphql_1.GraphQLID;
292
+ else
293
+ type = (0, graphql_1.GraphQLNonNull)(graphql_1.GraphQLID);
288
294
  }
289
295
  acc[field.field] = {
290
296
  type,
@@ -397,7 +403,7 @@ class GraphQLService {
397
403
  * Create readable types and attach resolvers for each. Also prepares full filter argument structures
398
404
  */
399
405
  function getReadableTypes() {
400
- var _a, _b, _c, _d, _e, _f;
406
+ var _a, _b, _c, _d, _e, _f, _g, _h;
401
407
  const { CollectionTypes: ReadCollectionTypes } = getTypes('read');
402
408
  const ReadableCollectionFilterTypes = {};
403
409
  const AggregatedFunctions = {};
@@ -894,10 +900,12 @@ class GraphQLService {
894
900
  }
895
901
  }
896
902
  else if ((_f = relation.meta) === null || _f === void 0 ? void 0 : _f.one_allowed_collections) {
897
- /**
898
- * @TODO
899
- * Looking to add nested typed filters per union type? This is where that's supposed to go.
900
- */
903
+ (_g = ReadableCollectionFilterTypes[relation.collection]) === null || _g === void 0 ? void 0 : _g.removeField('item');
904
+ for (const collection of relation.meta.one_allowed_collections) {
905
+ (_h = ReadableCollectionFilterTypes[relation.collection]) === null || _h === void 0 ? void 0 : _h.addFields({
906
+ [`item__${collection}`]: ReadableCollectionFilterTypes[collection],
907
+ });
908
+ }
901
909
  }
902
910
  }
903
911
  return { ReadCollectionTypes, ReadableCollectionFilterTypes };
@@ -216,7 +216,9 @@ class ItemsService {
216
216
  */
217
217
  async readByQuery(query, opts) {
218
218
  const updatedQuery = (opts === null || opts === void 0 ? void 0 : opts.emitEvents) !== false
219
- ? await emitter_1.default.emitFilter(`${this.eventScope}.query`, query, {
219
+ ? await emitter_1.default.emitFilter(this.eventScope === 'items'
220
+ ? ['items.query', `${this.collection}.items.query`]
221
+ : `${this.eventScope}.query`, query, {
220
222
  collection: this.collection,
221
223
  }, {
222
224
  database: this.knex,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "directus",
3
- "version": "9.18.0",
3
+ "version": "9.18.1",
4
4
  "license": "GPL-3.0-only",
5
5
  "homepage": "https://github.com/directus/directus#readme",
6
6
  "description": "Directus is a real-time API and App dashboard for managing SQL database content.",
@@ -66,16 +66,16 @@
66
66
  ],
67
67
  "dependencies": {
68
68
  "@aws-sdk/client-ses": "^3.107.0",
69
- "@directus/app": "9.18.0",
70
- "@directus/drive": "9.18.0",
71
- "@directus/drive-azure": "9.18.0",
72
- "@directus/drive-gcs": "9.18.0",
73
- "@directus/drive-s3": "9.18.0",
69
+ "@directus/app": "9.18.1",
70
+ "@directus/drive": "9.18.1",
71
+ "@directus/drive-azure": "9.18.1",
72
+ "@directus/drive-gcs": "9.18.1",
73
+ "@directus/drive-s3": "9.18.1",
74
74
  "@directus/extensions-sdk": "^9.14.1",
75
75
  "@directus/format-title": "^9.15.0",
76
- "@directus/schema": "9.18.0",
77
- "@directus/shared": "9.18.0",
78
- "@directus/specs": "9.18.0",
76
+ "@directus/schema": "9.18.1",
77
+ "@directus/shared": "9.18.1",
78
+ "@directus/specs": "9.18.1",
79
79
  "@godaddy/terminus": "^4.10.2",
80
80
  "@rollup/plugin-alias": "^3.1.9",
81
81
  "@rollup/plugin-virtual": "^2.1.0",