我正在尝试创建一个使用 useQuery 导出功能的包
但是我收到以下错误:
Could not find "client" in the context or passed in as an option. Wrap the root component in an <ApolloProvider>, or pass an ApolloClient instance in via options.
这甚至是最简单的示例,它只导出 useQuery (obvs 实际代码不止于此)
我知道我的代码没问题,否则就好像我使用导入 useQuery
import { useQuery } from '@apollo/react-hooks'
它工作正常
简单的例子在这里..