graphile-settings 4.14.0 → 4.15.0

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.
@@ -12,12 +12,13 @@ export function buildBelongsToRelations(codec, attributes, uniques, relations, c
12
12
  continue;
13
13
  const localAttributes = relation.localAttributes || [];
14
14
  const isUnique = uniques.some((unique) => sameAttributes(unique.attributes, localAttributes));
15
+ const remoteCodec = relation.remoteResource?.codec;
15
16
  belongsTo.push({
16
17
  fieldName: relationName,
17
18
  isUnique,
18
- type: relation.remoteResource?.codec?.name || null,
19
+ type: remoteCodec?.name || null,
19
20
  keys: buildFieldList(localAttributes, codec, attributes, context),
20
- references: { name: relation.remoteResource?.codec?.name || 'unknown' },
21
+ references: { name: remoteCodec?.name || 'unknown' },
21
22
  });
22
23
  }
23
24
  return belongsTo;
@@ -31,12 +32,13 @@ export function buildReverseRelations(codec, attributes, relations, context) {
31
32
  const remoteUniques = getUniques(relation.remoteResource || {});
32
33
  const remoteAttributes = relation.remoteAttributes || [];
33
34
  const isUnique = remoteUniques.some((unique) => sameAttributes(unique.attributes, remoteAttributes));
35
+ const remoteCodec = relation.remoteResource?.codec;
34
36
  const meta = {
35
37
  fieldName: relationName,
36
38
  isUnique,
37
- type: relation.remoteResource?.codec?.name || null,
39
+ type: remoteCodec?.name || null,
38
40
  keys: buildFieldList(relation.localAttributes || [], codec, attributes, context),
39
- referencedBy: { name: relation.remoteResource?.codec?.name || 'unknown' },
41
+ referencedBy: { name: remoteCodec?.name || 'unknown' },
40
42
  };
41
43
  if (isUnique) {
42
44
  hasOne.push(meta);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-settings",
3
- "version": "4.14.0",
3
+ "version": "4.15.0",
4
4
  "author": "Constructive <developers@constructive.io>",
5
5
  "description": "graphile settings",
6
6
  "main": "index.js",
@@ -53,7 +53,7 @@
53
53
  "graphile-upload-plugin": "^2.4.4",
54
54
  "graphile-utils": "5.0.0-rc.8",
55
55
  "graphql": "16.13.0",
56
- "inflekt": "^0.3.3",
56
+ "inflekt": "^0.5.0",
57
57
  "lru-cache": "^11.2.7",
58
58
  "pg": "^8.20.0",
59
59
  "pg-query-context": "^2.8.3",
@@ -80,5 +80,5 @@
80
80
  "constructive",
81
81
  "graphql"
82
82
  ],
83
- "gitHead": "6eb4389816805b64af3a2aa18b29a08f37bb013f"
83
+ "gitHead": "2660dbd64e96cdb785ace8b28fbf9275cb3812aa"
84
84
  }
@@ -17,12 +17,13 @@ function buildBelongsToRelations(codec, attributes, uniques, relations, context)
17
17
  continue;
18
18
  const localAttributes = relation.localAttributes || [];
19
19
  const isUnique = uniques.some((unique) => (0, table_resource_utils_1.sameAttributes)(unique.attributes, localAttributes));
20
+ const remoteCodec = relation.remoteResource?.codec;
20
21
  belongsTo.push({
21
22
  fieldName: relationName,
22
23
  isUnique,
23
- type: relation.remoteResource?.codec?.name || null,
24
+ type: remoteCodec?.name || null,
24
25
  keys: (0, table_meta_context_1.buildFieldList)(localAttributes, codec, attributes, context),
25
- references: { name: relation.remoteResource?.codec?.name || 'unknown' },
26
+ references: { name: remoteCodec?.name || 'unknown' },
26
27
  });
27
28
  }
28
29
  return belongsTo;
@@ -36,12 +37,13 @@ function buildReverseRelations(codec, attributes, relations, context) {
36
37
  const remoteUniques = (0, table_resource_utils_1.getUniques)(relation.remoteResource || {});
37
38
  const remoteAttributes = relation.remoteAttributes || [];
38
39
  const isUnique = remoteUniques.some((unique) => (0, table_resource_utils_1.sameAttributes)(unique.attributes, remoteAttributes));
40
+ const remoteCodec = relation.remoteResource?.codec;
39
41
  const meta = {
40
42
  fieldName: relationName,
41
43
  isUnique,
42
- type: relation.remoteResource?.codec?.name || null,
44
+ type: remoteCodec?.name || null,
43
45
  keys: (0, table_meta_context_1.buildFieldList)(relation.localAttributes || [], codec, attributes, context),
44
- referencedBy: { name: relation.remoteResource?.codec?.name || 'unknown' },
46
+ referencedBy: { name: remoteCodec?.name || 'unknown' },
45
47
  };
46
48
  if (isUnique) {
47
49
  hasOne.push(meta);