/* eslint-disable prettier/prettier */
/* eslint-disable @typescript-eslint/no-inferrable-types */

import { Observable } from "rxjs";
import { QueryClient } from "./QueryClient";
import { ApolloClientQuery } from "./QueryClient.ApolloClient";
import { RegularClientQuery } from "./QueryClient.RegularClient";

export class ClientManager {

	clientInstance: QueryClient;

	constructor(type: string) {

		if (type == 'ApolloClient') {
			this.clientInstance = new ApolloClientQuery();
		}
		else {
			this.clientInstance = new RegularClientQuery();
		}
	}

	sendQuery(queryString: string): Observable<any> {
		console.log(process.env.GRAPHQL_HOST)
		return this.clientInstance.sendQuery(queryString);;
	}

	setCacheOn() {
		this.clientInstance.setCacheOn();
	}

	setCacheOff() {
		this.clientInstance.setCacheOff();
	}

}