2

i'm using the graphql-request npm package in order to use graphql in my software. i have the following line in my code:

const client: GraphQLClient = new GraphQLClient(process.env.OCEAN_ENDPOINT, {});
client.setHeaders({ Authorization: `Bearer: ${token}` });

and then i want to fire a request i use:

await client.request(query, variables);

until two days ago my endpoint was an http url, but now it changed to https and from that moment i'm getting this error:

FetchError: request to https://{graphqlEndpoint}/v1/graphql failed, reason: unable to verify the first certificate

has anyone faced this issue before?

Tomer Elkayam
  • 23
  • 1
  • 4
  • Does this answer your question? [Error: unable to verify the first certificate in nodejs](https://stackoverflow.com/questions/31673587/error-unable-to-verify-the-first-certificate-in-nodejs) – Herku Feb 15 '22 at 22:43

1 Answers1

2

NODE_TLS_REJECT_UNAUTHORIZED = "0";

adding this in env worked for me in nextjs project