DataStore - 订阅错误,连接失败:

问题描述 投票:0回答:2

我正在开发 React Native、AWS、DynamoDB、Amplify 项目,并且正在努力向数据库添加额外的表(模型)。

最初的模式非常简单。 (可能太简单了,没有效果)

type Capture @model {
    id: ID!
    captureID: String!
    userID: String!
    moodScore: String
    emotion: String
    lifeAspect: String
    activity: String
    companions: String
    location: String
    date: String
    images: String
    journalEntry: String
}

用户不断捕捉生活中的瞬间。所有内容都存储为字符串(出于某种原因......)。

我正在尝试向应用程序添加更多表格。新表并未真正连接到当前表。连接数据和用户 ID 的唯一东西,是用户登录时从“amplify/auth”获得的。

我在 schema.graphql 中添加了第二个模型:

type Capture @model {
    id: ID!
    captureID: String!
    userID: String!
    moodScore: String
    emotion: String
    lifeAspect: String
    activity: String
    companions: String
    location: String
    date: String
    images: String
    journalEntry: String
}

type DbConversion @model {
    id: ID!
    userID: String!
    ConversionID: [String!]
}

我不希望在 DynameDB 中连接表。我想使用 DataStore 仅在用户登录时加载当前用户的数据。

let uuID = '';
// Configure datastore to sync based on user identifier.
DataStore.configure({
    syncExpressions: [
        syncExpression(Capture, () => {
            return (capture) => capture.userID('eq', uuID);
        }),
        syncExpression(DbConversion, () => {
            return (dbconversion) => dbconversion.userID('eq', uuID);
        }),
    ],
});

// Retrieve user ID and reset datastore sync with new data for uuID.
export async function changeSync() {
    uuID = await getData('userID');
    await DataStore.stop();
    await DataStore.start();
}

一切工作正常,直到我尝试添加第二个表。之后,我开始收到巨大的警告消息:

[WARN] 37:23.730 DataStore - subscriptionError, Connection failed: {"errors":[{"message":"Validation error of type FieldUndefined: Field '_version' in type 'Capture' is undefined @ 'onCreateCapture/_version'"},{"message":"Validation error of type FieldUndefined: Field '_lastChangedAt' in type 'Capture' is undefined @ 'onCreateCapture/_lastChangedAt'"},{"message":"Validation error of type FieldUndefined: Field '_deleted' in type 'Capture' is undefined @ 'onCreateCapture/_deleted'"}]}
at node_modules\react-native\Libraries\LogBox\LogBox.js:117:10 in registerWarning
at node_modules\react-native\Libraries\LogBox\LogBox.js:63:8 in warnImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:36:4 in console.warn
at node_modules\expo\build\environment\react-native-logs.fx.js:18:4 in warn
at node_modules\@aws-amplify\core\lib-esm\Logger\ConsoleLogger.js:138:12 in prototype._log
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:146334:21 in warn
at node_modules\@aws-amplify\datastore\lib-esm\sync\processors\subscription.js:357:87 in queryObservable.map.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\zen-observable\lib\Observable.js:329:17 in _this2.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\@aws-amplify\pubsub\lib-esm\PubSub.js:180:37 in observable.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\@aws-amplify\pubsub\lib-esm\Providers\AWSAppSyncRealTimeProvider.js:507:12 in prototype._handleIncomingSubscriptionMessage
at node_modules\event-target-shim\dist\event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
at node_modules\react-native\Libraries\WebSocket\WebSocket.js:231:8 in _eventEmitter.addListener$argument_1
at node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js:189:10 in emit
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:416:4 in __callFunction
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:109:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:108:4 in callFunctionReturnFlushedQueue

[WARN] 37:23.830 DataStore - subscriptionError, Connection failed: {"errors":[{"message":"Validation error of type FieldUndefined: Field '_version' in type 'Capture' is undefined @ 'onUpdateCapture/_version'"},{"message":"Validation error of type FieldUndefined: Field '_lastChangedAt' in type 'Capture' is undefined @ 'onUpdateCapture/_lastChangedAt'"},{"message":"Validation error of type FieldUndefined: Field '_deleted' in type 'Capture' is undefined @ 'onUpdateCapture/_deleted'"}]}
at node_modules\react-native\Libraries\LogBox\LogBox.js:117:10 in registerWarning
at node_modules\react-native\Libraries\LogBox\LogBox.js:63:8 in warnImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:36:4 in console.warn
at node_modules\expo\build\environment\react-native-logs.fx.js:18:4 in warn
at node_modules\@aws-amplify\core\lib-esm\Logger\ConsoleLogger.js:138:12 in prototype._log
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:146334:21 in warn
at node_modules\@aws-amplify\datastore\lib-esm\sync\processors\subscription.js:357:87 in queryObservable.map.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\zen-observable\lib\Observable.js:329:17 in _this2.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\@aws-amplify\pubsub\lib-esm\PubSub.js:180:37 in observable.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\@aws-amplify\pubsub\lib-esm\Providers\AWSAppSyncRealTimeProvider.js:507:12 in prototype._handleIncomingSubscriptionMessage
at node_modules\event-target-shim\dist\event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
at node_modules\react-native\Libraries\WebSocket\WebSocket.js:231:8 in _eventEmitter.addListener$argument_1
at node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js:189:10 in emit
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:416:4 in __callFunction
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:109:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:108:4 in callFunctionReturnFlushedQueue

[WARN] 37:23.896 DataStore - subscriptionError, Connection failed: {"errors":[{"message":"Validation error of type FieldUndefined: Field '_version' in type 'DbConversion' is undefined @ 'onCreateDbConversion/_version'"},{"message":"Validation error of type FieldUndefined: Field '_lastChangedAt' in type 'DbConversion' is undefined @ 'onCreateDbConversion/_lastChangedAt'"},{"message":"Validation error of type FieldUndefined: Field '_deleted' in type 'DbConversion' is undefined @ 'onCreateDbConversion/_deleted'"}]}
at node_modules\react-native\Libraries\LogBox\LogBox.js:117:10 in registerWarning
at node_modules\react-native\Libraries\LogBox\LogBox.js:63:8 in warnImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:36:4 in console.warn
at node_modules\expo\build\environment\react-native-logs.fx.js:18:4 in warn
at node_modules\@aws-amplify\core\lib-esm\Logger\ConsoleLogger.js:138:12 in prototype._log
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:146334:21 in warn
at node_modules\@aws-amplify\datastore\lib-esm\sync\processors\subscription.js:357:87 in queryObservable.map.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\zen-observable\lib\Observable.js:329:17 in _this2.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\@aws-amplify\pubsub\lib-esm\PubSub.js:180:37 in observable.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\@aws-amplify\pubsub\lib-esm\Providers\AWSAppSyncRealTimeProvider.js:507:12 in prototype._handleIncomingSubscriptionMessage
at node_modules\event-target-shim\dist\event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
at node_modules\react-native\Libraries\WebSocket\WebSocket.js:231:8 in _eventEmitter.addListener$argument_1
at node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js:189:10 in emit
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:416:4 in __callFunction
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:109:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:108:4 in callFunctionReturnFlushedQueue

[WARN] 37:23.967 DataStore - subscriptionError, Connection failed: {"errors":[{"message":"Validation error of type FieldUndefined: Field '_version' in type 'Capture' is undefined @ 'onDeleteCapture/_version'"},{"message":"Validation error of type FieldUndefined: Field '_lastChangedAt' in type 'Capture' is undefined @ 'onDeleteCapture/_lastChangedAt'"},{"message":"Validation error of type FieldUndefined: Field '_deleted' in type 'Capture' is undefined @ 'onDeleteCapture/_deleted'"}]}
at node_modules\react-native\Libraries\LogBox\LogBox.js:117:10 in registerWarning
at node_modules\react-native\Libraries\LogBox\LogBox.js:63:8 in warnImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:36:4 in console.warn
at node_modules\expo\build\environment\react-native-logs.fx.js:18:4 in warn
at node_modules\@aws-amplify\core\lib-esm\Logger\ConsoleLogger.js:138:12 in prototype._log
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:146334:21 in warn
at node_modules\@aws-amplify\datastore\lib-esm\sync\processors\subscription.js:357:87 in queryObservable.map.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\zen-observable\lib\Observable.js:329:17 in _this2.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\@aws-amplify\pubsub\lib-esm\PubSub.js:180:37 in observable.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\@aws-amplify\pubsub\lib-esm\Providers\AWSAppSyncRealTimeProvider.js:507:12 in prototype._handleIncomingSubscriptionMessage
at node_modules\event-target-shim\dist\event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
at node_modules\react-native\Libraries\WebSocket\WebSocket.js:231:8 in _eventEmitter.addListener$argument_1
at node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js:189:10 in emit
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:416:4 in __callFunction
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:109:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:108:4 in callFunctionReturnFlushedQueue

[WARN] 37:24.77 DataStore - subscriptionError, Connection failed: {"errors":[{"message":"Validation error of type FieldUndefined: Field '_version' in type 'DbConversion' is undefined @ 'onDeleteDbConversion/_version'"},{"message":"Validation error of type FieldUndefined: Field '_lastChangedAt' in type 'DbConversion' is undefined @ 'onDeleteDbConversion/_lastChangedAt'"},{"message":"Validation error of type FieldUndefined: Field '_deleted' in type 'DbConversion' is undefined @ 'onDeleteDbConversion/_deleted'"}]}
at node_modules\react-native\Libraries\LogBox\LogBox.js:117:10 in registerWarning
at node_modules\react-native\Libraries\LogBox\LogBox.js:63:8 in warnImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:36:4 in console.warn
at node_modules\expo\build\environment\react-native-logs.fx.js:18:4 in warn
at node_modules\@aws-amplify\core\lib-esm\Logger\ConsoleLogger.js:138:12 in prototype._log
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:146334:21 in warn
at node_modules\@aws-amplify\datastore\lib-esm\sync\processors\subscription.js:357:87 in queryObservable.map.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\zen-observable\lib\Observable.js:329:17 in _this2.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\@aws-amplify\pubsub\lib-esm\PubSub.js:180:37 in observable.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\@aws-amplify\pubsub\lib-esm\Providers\AWSAppSyncRealTimeProvider.js:507:12 in prototype._handleIncomingSubscriptionMessage
at node_modules\event-target-shim\dist\event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
at node_modules\react-native\Libraries\WebSocket\WebSocket.js:231:8 in _eventEmitter.addListener$argument_1
at node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js:189:10 in emit
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:416:4 in __callFunction
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:109:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:108:4 in callFunctionReturnFlushedQueue

[WARN] 37:24.155 DataStore - subscriptionError, Connection failed: {"errors":[{"message":"Validation error of type FieldUndefined: Field '_version' in type 'DbConversion' is undefined @ 'onUpdateDbConversion/_version'"},{"message":"Validation error of type FieldUndefined: Field '_lastChangedAt' in type 'DbConversion' is undefined @ 'onUpdateDbConversion/_lastChangedAt'"},{"message":"Validation error of type FieldUndefined: Field '_deleted' in type 'DbConversion' is undefined @ 'onUpdateDbConversion/_deleted'"}]}
at node_modules\react-native\Libraries\LogBox\LogBox.js:117:10 in registerWarning
at node_modules\react-native\Libraries\LogBox\LogBox.js:63:8 in warnImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:36:4 in console.warn
at node_modules\expo\build\environment\react-native-logs.fx.js:18:4 in warn
at node_modules\@aws-amplify\core\lib-esm\Logger\ConsoleLogger.js:138:12 in prototype._log
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:146334:21 in warn
at node_modules\@aws-amplify\datastore\lib-esm\sync\processors\subscription.js:357:87 in queryObservable.map.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\zen-observable\lib\Observable.js:329:17 in _this2.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\@aws-amplify\pubsub\lib-esm\PubSub.js:180:37 in observable.subscribe$argument_0.error
at node_modules\zen-observable\lib\Observable.js:139:8 in notifySubscription
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:150453:22 in onNotify
at node_modules\zen-observable\lib\Observable.js:239:11 in error
at node_modules\@aws-amplify\pubsub\lib-esm\Providers\AWSAppSyncRealTimeProvider.js:507:12 in prototype._handleIncomingSubscriptionMessage
at node_modules\event-target-shim\dist\event-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
at node_modules\react-native\Libraries\WebSocket\WebSocket.js:231:8 in _eventEmitter.addListener$argument_1
at node_modules\react-native\Libraries\vendor\emitter\EventEmitter.js:189:10 in emit
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:416:4 in __callFunction
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:109:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:108:4 in callFunctionReturnFlushedQueue

Setting a timer for a long period of time, i.e. multiple minutes, is a performance and correctness issue on Android as it keeps the timer module awake, and timers can only be called when the app is in the foreground. See https://github.com/facebook/react-native/issues/12981 for more info.
(Saw setTimeout with duration 102478.61620927726ms)
at node_modules\react-native\Libraries\LogBox\LogBox.js:117:10 in registerWarning
at node_modules\react-native\Libraries\LogBox\LogBox.js:63:8 in warnImpl
at node_modules\react-native\Libraries\LogBox\LogBox.js:36:4 in console.warn
at node_modules\expo\build\environment\react-native-logs.fx.js:18:4 in warn
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:226:6 in setTimeout
at node_modules\@aws-amplify\core\lib-esm\Util\Retry.js:116:45 in __generator$argument_1
at node_modules\react-native\node_modules\promise\setimmediate\core.js:45:6 in tryCallTwo
at node_modules\react-native\node_modules\promise\setimmediate\core.js:200:22 in doResolve
at node_modules\react-native\node_modules\promise\setimmediate\core.js:66:11 in Promise
at node_modules\@aws-amplify\core\lib-esm\Util\Retry.js:115:40 in __generator$argument_1
at http://192.168.0.105:19000/node_modules%5Cexpo%5CAppEntry.bundle?platform=android&dev=true&hot=false&minify=false:147977:26 in step
at node_modules\tslib\tslib.js:122:34 in <anonymous>
at node_modules\tslib\tslib.js:113:43 in rejected
at node_modules\react-native\node_modules\promise\setimmediate\core.js:37:13 in tryCallOne
at node_modules\react-native\node_modules\promise\setimmediate\core.js:123:24 in setImmediate$argument_0
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:130:14 in _callTimer
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:181:14 in _callImmediatesPass
at node_modules\react-native\Libraries\Core\Timers\JSTimers.js:441:30 in callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:387:6 in __callImmediates
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:135:6 in __guard$argument_0
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:364:10 in __guard
at node_modules\react-native\Libraries\BatchedBridge\MessageQueue.js:134:4 in flushedQueue
amazon-web-services graphql aws-amplify
2个回答
0
投票

我在GitHub论坛上找到了解决方案: https://github.com/aws-amplify/amplify-js/issues/4535#issuecomment-589594827

这使得我的 API 可同步,并且警告消失了:

You could also add this you the transform.conf.json directly:
{ "Version": 5, "ResolverConfig": { "project": { "ConflictHandler": "AUTOMERGE", "ConflictDetection": "VERSION" } } }

下一个问题是,这之前是如何运作的? :D


0
投票

您可以通过运行

amplify update api
>
GraphQL
> 进行检查 > 您是否有启用或禁用冲突检测的选项?

如果已启用,请尝试运行

amplify push
以确保部署更改,然后运行
amplify codegen models
在本地重新生成数据存储模型。

这为我解决了这个问题。答案来自这个 github 线程:https://github.com/aws-amplify/amplify-js/issues/12473#issuecomment-1787330867

© www.soinside.com 2019 - 2024. All rights reserved.