hkjc-api
Version:
Node.js package for communicating with HKJC GraphQL API
16 lines (15 loc) • 584 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.defaultClient = exports.HKJCClient = void 0;
const graphql_request_1 = require("graphql-request");
class HKJCClient {
constructor(endpoint) {
this.client = new graphql_request_1.GraphQLClient(endpoint || "https://info.cld.hkjc.com/graphql/base/");
}
async request(query, variables) {
return this.client.request(query, variables);
}
}
exports.HKJCClient = HKJCClient;
// Add a singleton instance that can be imported directly
exports.defaultClient = new HKJCClient();