reactjs - React Apollo 客户端不发送 cookie
问题描述
我已经阅读了一些与我相关的其他问题,但无法得到答案。
import { ApolloClient, createHttpLink, InMemoryCache, ApolloProvider } from '@apollo/client';
const link = createHttpLink({
uri: 'https://example.com/graphql',
credentials: 'include'
});
const client = new ApolloClient({
link,
cache: new InMemoryCache(),
});
ReactDOM.render(
<React.StrictMode>
<ApolloProvider client={client} >
<App />
</ApolloProvider>
</React.StrictMode>,
document.getElementById('root')
);
这是我在所有反应应用程序中使用的代码,在这个应用程序中,我试图在本地主机中使用我的 graphql 后端,所以我认为问题就在那里。我在问题中收到此警告:
那么有谁知道这个问题或者我该如何解决它?
解决方案
推荐阅读
- c++ - 我的设备上的 c++ 编译器版本是什么
- python - Selenium 单击下一步按钮而不是后退按钮
- postgresql - azure + postgresql:如何修复错误:无法连接到服务器:服务器意外关闭了连接
- python - 谁能解释一下这种语法?
- php - 如何隐藏文件夹目录?用 htaccess 有可能吗?
- r - 针对本地机器规格调整 R 中的相对基准测试
- numpy - 如何根据数组中的位置更改 Numpy.random.choice 的 p 值?
- python - 当 Django 模型中的特定字段发生更改时,有没有办法触发操作
- sql - SQL*Plus Oracle DB - 使用布尔输出参数执行过程
- wordpress - wp-load.php 文件变空