@tinacms/graphql 1.4.30 → 1.4.32

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/dist/index.js CHANGED
@@ -2855,7 +2855,7 @@ var validateField = async (field) => {
2855
2855
  // package.json
2856
2856
  var package_default = {
2857
2857
  name: "@tinacms/graphql",
2858
- version: "1.4.30",
2858
+ version: "1.4.32",
2859
2859
  main: "dist/index.js",
2860
2860
  module: "dist/index.mjs",
2861
2861
  typings: "dist/index.d.ts",
@@ -4853,7 +4853,7 @@ var Resolver = class {
4853
4853
  if (reservedKeys.includes(key)) {
4854
4854
  return;
4855
4855
  }
4856
- if (oldDoc._template) {
4856
+ if (oldDoc._template && collection.templates) {
4857
4857
  const template = (_a = collection.templates) == null ? void 0 : _a.find(
4858
4858
  ({ name }) => name === oldDoc._template
4859
4859
  );
@@ -4862,7 +4862,8 @@ var Resolver = class {
4862
4862
  legacyValues[key] = value;
4863
4863
  }
4864
4864
  }
4865
- } else {
4865
+ }
4866
+ if (oldDoc._collection && collection.fields) {
4866
4867
  if (!collection.fields.find(({ name }) => name === key)) {
4867
4868
  legacyValues[key] = value;
4868
4869
  }
@@ -5080,7 +5081,7 @@ var Resolver = class {
5080
5081
  if (Array.isArray(fieldValue)) {
5081
5082
  if (fieldValue.length === 0) {
5082
5083
  accum[fieldName] = [];
5083
- break;
5084
+ continue;
5084
5085
  }
5085
5086
  }
5086
5087
  const field = template.fields.find((field2) => field2.name === fieldName);
@@ -6575,6 +6576,7 @@ var Database = class {
6575
6576
  clearCache() {
6576
6577
  this.tinaSchema = null;
6577
6578
  this._lookup = null;
6579
+ this.collectionIndexDefinitions = null;
6578
6580
  }
6579
6581
  async indexStatusCallbackWrapper(fn, post) {
6580
6582
  await this.indexStatusCallback({ status: "inprogress" });
package/dist/index.mjs CHANGED
@@ -2788,7 +2788,7 @@ var validateField = async (field) => {
2788
2788
  // package.json
2789
2789
  var package_default = {
2790
2790
  name: "@tinacms/graphql",
2791
- version: "1.4.30",
2791
+ version: "1.4.32",
2792
2792
  main: "dist/index.js",
2793
2793
  module: "dist/index.mjs",
2794
2794
  typings: "dist/index.d.ts",
@@ -4780,7 +4780,7 @@ var Resolver = class {
4780
4780
  if (reservedKeys.includes(key)) {
4781
4781
  return;
4782
4782
  }
4783
- if (oldDoc._template) {
4783
+ if (oldDoc._template && collection.templates) {
4784
4784
  const template = collection.templates?.find(
4785
4785
  ({ name }) => name === oldDoc._template
4786
4786
  );
@@ -4789,7 +4789,8 @@ var Resolver = class {
4789
4789
  legacyValues[key] = value;
4790
4790
  }
4791
4791
  }
4792
- } else {
4792
+ }
4793
+ if (oldDoc._collection && collection.fields) {
4793
4794
  if (!collection.fields.find(({ name }) => name === key)) {
4794
4795
  legacyValues[key] = value;
4795
4796
  }
@@ -5006,7 +5007,7 @@ var Resolver = class {
5006
5007
  if (Array.isArray(fieldValue)) {
5007
5008
  if (fieldValue.length === 0) {
5008
5009
  accum[fieldName] = [];
5009
- break;
5010
+ continue;
5010
5011
  }
5011
5012
  }
5012
5013
  const field = template.fields.find((field2) => field2.name === fieldName);
@@ -6495,6 +6496,7 @@ var Database = class {
6495
6496
  clearCache() {
6496
6497
  this.tinaSchema = null;
6497
6498
  this._lookup = null;
6499
+ this.collectionIndexDefinitions = null;
6498
6500
  }
6499
6501
  async indexStatusCallbackWrapper(fn, post) {
6500
6502
  await this.indexStatusCallback({ status: "inprogress" });
@@ -55,12 +55,7 @@ export declare class Resolver {
55
55
  templates?: undefined;
56
56
  label?: string;
57
57
  name: string;
58
- path: string; /**
59
- * `collectionName` is passed in:
60
- * * `addPendingDocument()` has `collection` on `args`
61
- * * `getDocument()` provides a `collection` on `args`
62
- * * `get<Collection>Document()` has `collection` on `lookup`
63
- */
58
+ path: string;
64
59
  indexes?: {
65
60
  name: string;
66
61
  fields: {
@@ -88,12 +83,7 @@ export declare class Resolver {
88
83
  fields?: undefined;
89
84
  label?: string;
90
85
  name: string;
91
- path: string; /**
92
- * `collectionName` is passed in:
93
- * * `addPendingDocument()` has `collection` on `args`
94
- * * `getDocument()` provides a `collection` on `args`
95
- * * `get<Collection>Document()` has `collection` on `lookup`
96
- */
86
+ path: string;
97
87
  indexes?: {
98
88
  name: string;
99
89
  fields: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/graphql",
3
- "version": "1.4.30",
3
+ "version": "1.4.32",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "typings": "dist/index.d.ts",
@@ -24,8 +24,8 @@
24
24
  },
25
25
  "dependencies": {
26
26
  "@iarna/toml": "^2.2.5",
27
- "@tinacms/mdx": "1.3.22",
28
- "@tinacms/schema-tools": "1.4.14",
27
+ "@tinacms/mdx": "1.3.23",
28
+ "@tinacms/schema-tools": "1.4.15",
29
29
  "abstract-level": "^1.0.3",
30
30
  "body-parser": "^1.19.0",
31
31
  "cors": "^2.8.5",
@@ -58,7 +58,7 @@
58
58
  "directory": "packages/tina-graphql"
59
59
  },
60
60
  "devDependencies": {
61
- "@tinacms/schema-tools": "1.4.14",
61
+ "@tinacms/schema-tools": "1.4.15",
62
62
  "@tinacms/scripts": "1.1.3",
63
63
  "@types/cors": "^2.8.7",
64
64
  "@types/estree": "^0.0.50",