My current setup is:
import {
ApolloClient,
ApolloProvider,
gql,
HttpLink,
} from '@apollo/client';
import fetch from 'node-fetch';
import { Agent } from 'https';
...
const agent = new Agent({
rejectUnauthorized: false,
});
const httpLink = new HttpLink({
uri: process.env.REACT_APP_GRAPHQL_URL,
fetch: fetch,
fetchOptions: {
agent: agent
},
});
...
const client = new ApolloClient({
link: httpLink,
cache: cache,
typeDefs,
connectToDevTools: true,
});
...
ReactDOM.render(
<ApolloProvider client={client}>
<App />
</ApolloProvider>,
document.getElementById('root')
);
When I useQuery
I get createHttpLink.ts:121 POST https://*****.test/wp/graphql net::ERR_CERT_INVALID
. From what I can tell this is the current way to use a self-signed certificate but it doesn't seem to work. i can't find any documentation otherwise. What's wrong with my current implementation that seems to be ignoring the reject?