|
@@ -39,7 +39,7 @@ const {queryPub, createQuery, withQueryFunc} = createQueryPub({
|
|
//queryPub.subscribe(() => console.log(JSON.stringify(queryPub.queries.user, null, 4)))
|
|
//queryPub.subscribe(() => console.log(JSON.stringify(queryPub.queries.user, null, 4)))
|
|
|
|
|
|
const {useGoodsQuery} = createQuery({promiseName: 'goods',
|
|
const {useGoodsQuery} = createQuery({promiseName: 'goods',
|
|
- cacheTagFunc: (payload) => payload.data.GoodFind.map(good => ({type: 'Good', id: good._id}))})
|
|
|
|
|
|
+ cacheTagsFunc: (payload) => payload.data.GoodFind.map(good => ({type: 'Good', id: good._id}))})
|
|
|
|
|
|
//const {useUserQuery} = createQuery({
|
|
//const {useUserQuery} = createQuery({
|
|
//promiseName: 'user',
|
|
//promiseName: 'user',
|
|
@@ -50,7 +50,7 @@ const {useGoodsQuery} = createQuery({promiseName: 'goods',
|
|
//}
|
|
//}
|
|
//}
|
|
//}
|
|
//`],
|
|
//`],
|
|
- //cacheTagFunc: ({data: {UserFindOne: {_id}}}) => ({_id, type: 'User'})
|
|
|
|
|
|
+ //cacheTagsFunc: ({data: {UserFindOne: {_id}}}) => ({_id, type: 'User'})
|
|
//})
|
|
//})
|
|
//const userState = useUserQuery({query: JSON.stringify([{_id: '667ff0da2232120c7c871f7c'}])})
|
|
//const userState = useUserQuery({query: JSON.stringify([{_id: '667ff0da2232120c7c871f7c'}])})
|
|
|
|
|
|
@@ -63,7 +63,7 @@ const {useGoodsQuery} = createQuery({promiseName: 'goods',
|
|
//{query: JSON.stringify([{_id}])}
|
|
//{query: JSON.stringify([{_id}])}
|
|
//))({
|
|
//))({
|
|
//promiseName: 'user',
|
|
//promiseName: 'user',
|
|
- //cacheTagFunc: ({data: {UserFindOne: {_id}}}) => ({_id, type: 'User'})
|
|
|
|
|
|
+ //cacheTagsFunc: ({data: {UserFindOne: {_id}}}) => ({_id, type: 'User'})
|
|
//})
|
|
//})
|
|
|
|
|
|
|
|
|
|
@@ -76,7 +76,7 @@ const {useUserQuery} = createQuery({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
`, {query: JSON.stringify([{_id}])}],
|
|
`, {query: JSON.stringify([{_id}])}],
|
|
- cacheTagFunc: ({data: {UserFindOne: {_id}}}) => [{_id, type: 'User'}]
|
|
|
|
|
|
+ cacheTagsFunc: ({data: {UserFindOne: {_id}}}) => [{_id, type: 'User'}]
|
|
})
|
|
})
|
|
|
|
|
|
const {useUserMutation} = createQuery({
|
|
const {useUserMutation} = createQuery({
|
|
@@ -89,7 +89,7 @@ const {useUserMutation} = createQuery({
|
|
}
|
|
}
|
|
}`,
|
|
}`,
|
|
{_id, nick}],
|
|
{_id, nick}],
|
|
- cacheTagFunc: ({data: {UserUpsert: {_id}}}) => [{_id, type: 'User'}]
|
|
|
|
|
|
+ cacheTagsFunc: ({data: {UserUpsert: {_id}}}) => [{_id, type: 'User'}]
|
|
})
|
|
})
|
|
|
|
|
|
const EditNick = () => {
|
|
const EditNick = () => {
|