【发布时间】:2020-03-31 08:06:32
【问题描述】:
我正在尝试poll 查询我的问题。
client.query<gql.FileCsvImport, gql.FileCsvImportVariables>({
variables: { id: this.state.importId },
query: CSV_IMPORT,
pollInterval: 500,
})
但是我收到以下错误消息
Object literal may only specify known properties, and 'pollInterval' does not exist in type 'QueryOptions<FileCsvImportVariables>'
我清楚地看到docs中有这样一个选项
我在这里做错了什么?
我使用的是"react-apollo": "^3.1.1", 和"apollo-client": "^2.6.4", 版本
【问题讨论】:
-
使用 apollo boost 包 npm install apollo-boost @apollo/react-hooks graphql。让我知道这是否有效
-
是的,终于走上了这条路。现在使用钩子。
标签: reactjs typescript graphql react-apollo apollo-client