import { CustomQuery, Query } from './Query';
export class Resource {
    api;
    resourceName;
    env;
    constructor(api, resourceName, env) {
        this.api = api;
        this.resourceName = resourceName;
        this.env = env;
    }
    setQueries(resources) {
        Object.keys(resources).forEach(key => {
            this[key] = (params = {}) => Query(resources[key], // Setup the endpoint resources
            this.api, // Setup the base URL
            params, // Pass through the params
            this.env);
        });
    }
    /**
     * Custom GraphQL Queries
     * @param resources
     */
    query(resources) {
        Object.keys(resources).forEach(key => {
            this[key] = (params = {}) => CustomQuery(resources, // Setup the endpoint resources
            this.api, // Setup the base URL
            params);
        });
    }
}
