Is there a way to have an HTTPS endpoint for apollo react?

529 Views Asked by At

Following the apollo react documentation works fine when I have an http url, but when I use an endpoint with SSL then I run into CORS errors.

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: 
});

I get that the httpLink is for http, but I don't see any documentation on how to implement an https link.

1

There are 1 best solutions below

1
Ramakay On BEST ANSWER

I doubt this is a http link issue - is the client in https and does the endpoint in https as well as accept that origin ?