当我具有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链接的任何文档。
答案 0 :(得分:1)
我怀疑这是一个http链接问题-https中的客户端,并且https中的端点是否接受该来源?