【发布时间】:2020-10-05 23:29:12
【问题描述】:
我正在使用client.query() 方法从服务器查询。
我想使用 MockProvider 为这个功能编写测试。
由于client.query() 的异步性质,我面临问题
// I am writing the query as follow
const { data, loading } = await client.query({
query: Todo,
variables: { name },
fetchPolicy: 'cache-first'
})
【问题讨论】:
-
你应该发布你的测试
标签: javascript graphql react-apollo apollo-client