@tinacms/app 0.0.0-20221103131546 → 0.0.0-20221103203330

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.
@@ -298,13 +298,20 @@ export const queryMachine =
298
298
  rootValue: context.data,
299
299
  variableValues: context.variables,
300
300
  fieldResolver: (source, args, _context, info) => {
301
- const fieldNode = info.fieldNodes[0]
302
- const fieldName = fieldNode.alias?.value || fieldNode.name.value
303
- if (info.fieldNodes.length > 1) {
304
- // Not sure this happens much https://github.com/graphql/graphql-js/issues/605
305
- console.error(
306
- 'Unexpected multiple field nodes, is the query optimized?'
307
- )
301
+ const fieldName = info.fieldName
302
+ /**
303
+ * Formify adds `_internalSys` and `_internalValues` to the query
304
+ * and a user's query might also include `_values` or `_sys`, but
305
+ * it may not contain all of the info we need, so the actual
306
+ * source of truth for these values is our alias ones, which are
307
+ * also guaranteed to include all of the values another `_sys` query
308
+ * might include
309
+ */
310
+ if (fieldName === '_sys') {
311
+ return source._internalSys
312
+ }
313
+ if (fieldName === '_values') {
314
+ return source._internalValues
308
315
  }
309
316
  if (isNodeType(info.returnType)) {
310
317
  const existingValue = source[fieldName]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/app",
3
- "version": "0.0.0-20221103131546",
3
+ "version": "0.0.0-20221103203330",
4
4
  "main": "dist/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -37,8 +37,8 @@
37
37
  "@types/react": "17.0.2",
38
38
  "@types/react-dom": "17.0.2",
39
39
  "@tinacms/scripts": "0.51.3",
40
- "tinacms": "0.70.0",
41
- "@tinacms/mdx": "0.0.0-20221103131546",
40
+ "tinacms": "0.0.0-20221103203330",
41
+ "@tinacms/mdx": "0.0.0-20221103203330",
42
42
  "jest": "^27.0.6"
43
43
  },
44
44
  "dependencies": {