offline - 无法切换到 urql offlineExchange;运行时错误:TypeError:无法读取未定义的属性“长度”
问题描述
我正在尝试改用 urql offlineExchange。
收到以下错误:
<!-- language: lang-none -->
TypeError: Cannot read property 'length' of undefined
ha
https://rdududevw10sdn.dsa.int:3443/static/js/0.chunk.js:23933:10
Module../src/index.js
E:/CCase/sdickerson_wfm14216_view/AnsosWeb/WSM/Application/app/src/index.js:33
30 | optimistic: {},
31 | });
32 |
> 33 | const client = createClient({
34 | url: WSM_URL,
35 | exchanges: [dedupExchange, cache, fetchExchange],
36 | })
我正在尝试遵循离线支持文档(离线支持。
index.js:
const WSM_URL = '/api/gql'
const introspectedSchema = {
__schema: {
queryType: {name: 'Query',},
mutationType: {name: 'Mutation',},
subscriptionType: {name: 'Subscription',},
},
}
const storage = makeDefaultStorage({
idbName: 'graphcache-v3', // The name of the IndexedDB database
maxAge: 7, // The maximum age of the persisted data in days
})
const cache = offlineExchange({
schema: introspectedSchema,
storage,
updates: {},
optimistic: {},
});
const client = createClient({
url: WSM_URL,
exchanges: [dedupExchange, cache, fetchExchange],
})
解决方案
推荐阅读
- javascript - QML如何在更改为另一个qml时保存变量值
- r - partykit::mob() + mlogit: `错误没有指定合适的拟合函数`
- python - 根据另一列的值创建真或假列
- firebase - 如何发送 FCM 没有声音或振动?
- reactjs - React 酶还原剂测试,TypeError: (0 , _PlanReducer.default) 不是函数
- java - 如何在java中提示root访问权限
- github - 是否可以从 github api 获取 pom.xml 文件的内容?
- arrays - .map 不是函数 React.js
- python - 有没有办法用python中的括号替换字符串中的所有花括号?
- c# - DbReader IndexOutOfRangeException 性能命中