graphql - 有没有办法让阿波罗反应的 HTTPS 端点?
问题描述
当我有一个 http url 时,按照 apollo react 文档可以正常工作,但是当我使用带有 SSL 的端点时,我遇到了 CORS 错误。
import { ApolloClient} from 'apollo-boost';
import { HttpLink } from 'apollo-link-http';
const link = new HttpLink({
uri: 'https://mywebsite.dev/graphql',
useGETForQueries: true
});
const client = new ApolloClient({
cache,
link:
});
我知道 httpLink 是用于 http,但我没有看到任何关于如何实现 https 链接的文档。
解决方案
我怀疑这是一个 http 链接问题 - https 中的客户端和 https 中的端点是否接受该来源?
推荐阅读
- android - 基于神经网络的文本分析
- .net-core - 为什么我的本机库会因“非法指令”错误而使 .NET Core 崩溃?
- c# - Akka.net 通过 Docker 容器进行远程处理:客户端随机无法连接到主机
- git - 分叉分支在主分支后面 1 次提交时更新
- xamarin - 查询中的 Xamarin SQLite-Pcl-Net DateTIme
- python - 使用 .lower() 后如何恢复为大小写混合词?
- php - 在 Laravel Collective 的 Form::text() 内有条件地添加类
- rust - 我如何编写一个函数,允许我将类型 T 转换为任何 Box if Box
可以强制进入 Box吗? - javascript - Javascript:使用 clearInterval 停止 setInterval
- wpf - 单击切换按钮后如何设置我的 ColumnDefinition