Unable to connect to Cosmos DB Gremlin API from Apollo GraphQL

I am trying to connect to CosmosDB Gremlin API but I am unable to connect to it. I am using the below code snippet.
let endpoint = “wss://xxx.gremlin.cosmos.azure.com:443”;
let primaryKey = “-----------------------some key ---------------------------------------”;
let databaseId = “”;
let containerId = “”;
const client = new CosmosClient({ endpoint, primaryKey });
const database = client.database(databaseId);
const container = database.container(containerId);

I am getting the below error
Cannot connect to wss://xxx.gremlin.cosmos.azure.com:443 while allowInsecureConnection is false.