import { injectable } from '@cloudbeaver/core-di' ; import { CustomGraphQLClient } from './CustomGraphQLClient' ; import { EnvironmentService } from './EnvironmentService' ; import type { IResponseInterceptor } from './IResponseInterceptor' ; import { getSdk } from './sdk' ; @ injectable ( ) export class GraphQLService { sdk : ReturnType < typeof getSdk > ; readonly client : CustomGraphQLClient ; constructor ( private environmentService ) { const gqlEndpoint = this . environmentService . gqlEndpoint ; this . client = new CustomGraphQLClient ( gqlEndpoint ) ; this . sdk = getSdk ( this . client ) ; } registerInterceptor ( interceptor ) { this . client . registerInterceptor ( interceptor ) ; } enableRequests ( ) { this . client . enableRequests ( ) ; } blockRequests ( reason ) { this . client . blockRequests ( reason ) ; } }