29 lines
756 B
TypeScript
29 lines
756 B
TypeScript
import { getClientWithToken } from '../apollo/client';
|
|
import * as GQL from '../types';
|
|
import { BaseService } from './base';
|
|
import { type VariablesOf } from '@graphql-typed-document-node/core';
|
|
|
|
export class ServicesService extends BaseService {
|
|
async getService(variables: VariablesOf<typeof GQL.GetServiceDocument>) {
|
|
const { query } = await getClientWithToken();
|
|
|
|
const result = await query({
|
|
query: GQL.GetServiceDocument,
|
|
variables,
|
|
});
|
|
|
|
return result.data;
|
|
}
|
|
|
|
async getServices(variables: VariablesOf<typeof GQL.GetServicesDocument>) {
|
|
const { query } = await getClientWithToken();
|
|
|
|
const result = await query({
|
|
query: GQL.GetServicesDocument,
|
|
variables,
|
|
});
|
|
|
|
return result.data;
|
|
}
|
|
}
|