markdown refetchQueries警告

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown refetchQueries警告相关的知识,希望对你有一定的参考价值。

when I am using refetchQueries as below
```
mutationHandler<any, IPersonUpdateMutationVariable>({
  gqlName: PersonUpdateMutationGQL,
  mutate: mutate,
  refetchQueries: [PersonsGQL, PersonGQL],
  closeModal: props.closeModal
})
```
here PersonGQL has variable like below
```
export const PersonGQL = 'PersonGQL'
const PERSON_QUERY = gql`
query ${PersonGQL}($id: ID, $alias: String){
  person(
    id: $id
    alias: $alias
  ){
    id
    createdWhen
    name
    alias
    number
    address
    comment
    chugWonMun
  }
}
`
```

So, normally I have to pass variable to `refetchQueries` but it seems like I don't need to. and if I don't pass variables then it seems like it uses latest variable for that query.

以上是关于markdown refetchQueries警告的主要内容,如果未能解决你的问题,请参考以下文章

refetchQueries 仅适用于某些查询

Apollo 客户端 useMutation 挂钩中的 refetchQueries 问题

refetchQueries onComplete 回调

如何在 reactjs 16.8 中获取 refetchQueries 数据

将 refetchQueries 与 apollo 一起使用并做出反应

在 react-apollo 中使用 refetchQueries 时使用现有变量