我在stackoverflow上找到了这个解决方案:React Apollo Error: Invariant Violation: Could not find "client" in the contextor passed in as an option 但这并不能解决我的问题 在这种情况下,有人能帮我吗?ApolloProvider } from '@apollo/react-hooks';
import { ApolloClient, InMemoryCache } from '@ap
我试图使用React + GraphQL创建一个简单的博客,遵循这个中的步骤。然而,与这篇文章相反,我的博客并不存在于App.js中,而是一个子组件。GraphQL服务器运行良好。我可以独立地查询它,在不同的实现下,我可以得到所有的帖子。我放弃了这种方法,因为它太复杂了。
话虽如此,我不断地得到以下错误。Uncaught Invariant Violation: Could not find "client" in the context or passed in as an option.// co
此Formk表单工作正常,但当我在表单中使用"useMutation“钩子时,它会显示错误”无法在上下文中找到“客户端”或作为选项传入。将根组件包装在via选项中,或在via选项中传递ApolloClient实例“。我也使用了“变异”,这也会产生同样的错误。我认为错误在突变部分。= new ApolloClient({ uri: 'http://127.0.0.1:8000/graphql</e