Build Nuxt 4 client cabinet with Apollo and GraphQL flows
This commit is contained in:
713
app/composables/graphql/generated.ts
Normal file
713
app/composables/graphql/generated.ts
Normal file
@@ -0,0 +1,713 @@
|
||||
import gql from 'graphql-tag';
|
||||
import * as VueApolloComposable from '@vue/apollo-composable';
|
||||
import type * as VueCompositionApi from '@vue/composition-api';
|
||||
export type Maybe<T> = T | null;
|
||||
export type InputMaybe<T> = Maybe<T>;
|
||||
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
||||
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
||||
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
||||
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
|
||||
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
|
||||
export type ReactiveFunction<TParam> = () => TParam;
|
||||
/** All built-in and custom scalars, mapped to their actual values */
|
||||
export type Scalars = {
|
||||
ID: { input: string; output: string; }
|
||||
String: { input: string; output: string; }
|
||||
Boolean: { input: boolean; output: boolean; }
|
||||
Int: { input: number; output: number; }
|
||||
Float: { input: number; output: number; }
|
||||
DateTime: { input: any; output: any; }
|
||||
JSON: { input: any; output: any; }
|
||||
};
|
||||
|
||||
export type AcceptInvitationInput = {
|
||||
fullName: Scalars['String']['input'];
|
||||
token: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type AddBonusTransactionInput = {
|
||||
amount: Scalars['Float']['input'];
|
||||
orderId?: InputMaybe<Scalars['ID']['input']>;
|
||||
reason: Scalars['String']['input'];
|
||||
userId: Scalars['ID']['input'];
|
||||
};
|
||||
|
||||
export type BlockOrderInput = {
|
||||
orderId: Scalars['ID']['input'];
|
||||
reason: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type BonusTransaction = {
|
||||
__typename?: 'BonusTransaction';
|
||||
amount: Scalars['Float']['output'];
|
||||
createdAt: Scalars['DateTime']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
orderId?: Maybe<Scalars['ID']['output']>;
|
||||
reason: Scalars['String']['output'];
|
||||
userId: Scalars['ID']['output'];
|
||||
};
|
||||
|
||||
export type Company = {
|
||||
__typename?: 'Company';
|
||||
id: Scalars['ID']['output'];
|
||||
inn?: Maybe<Scalars['String']['output']>;
|
||||
name: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type ConnectMessengerInput = {
|
||||
channelId: Scalars['String']['input'];
|
||||
type: MessengerType;
|
||||
};
|
||||
|
||||
export type CreateInvitationInput = {
|
||||
companyName: Scalars['String']['input'];
|
||||
email: Scalars['String']['input'];
|
||||
expiresInDays?: InputMaybe<Scalars['Int']['input']>;
|
||||
};
|
||||
|
||||
export type CreateReferralInput = {
|
||||
refereeUserId: Scalars['ID']['input'];
|
||||
};
|
||||
|
||||
export enum Decision {
|
||||
Approve = 'APPROVE',
|
||||
Reject = 'REJECT'
|
||||
}
|
||||
|
||||
export type Invitation = {
|
||||
__typename?: 'Invitation';
|
||||
acceptedAt?: Maybe<Scalars['DateTime']['output']>;
|
||||
acceptedById?: Maybe<Scalars['ID']['output']>;
|
||||
companyName: Scalars['String']['output'];
|
||||
createdAt: Scalars['DateTime']['output'];
|
||||
email: Scalars['String']['output'];
|
||||
expiresAt: Scalars['DateTime']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
managerId: Scalars['ID']['output'];
|
||||
token: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type MessengerConnection = {
|
||||
__typename?: 'MessengerConnection';
|
||||
channelId: Scalars['String']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
isActive: Scalars['Boolean']['output'];
|
||||
type: MessengerType;
|
||||
userId: Scalars['ID']['output'];
|
||||
};
|
||||
|
||||
export enum MessengerType {
|
||||
Max = 'MAX',
|
||||
Telegram = 'TELEGRAM'
|
||||
}
|
||||
|
||||
export type Mutation = {
|
||||
__typename?: 'Mutation';
|
||||
acceptInvitation: User;
|
||||
addBonusTransaction: BonusTransaction;
|
||||
blockOrder: Order;
|
||||
clientReviewOrder: Order;
|
||||
completeOrder: Order;
|
||||
connectMessenger: MessengerConnection;
|
||||
createInvitation: Invitation;
|
||||
createReferral: ReferralLink;
|
||||
managerFinalizeOrder: Order;
|
||||
managerSetOrderOffer: Order;
|
||||
registerSelf: RegistrationRequest;
|
||||
requestRewardWithdrawal: RewardWithdrawalRequest;
|
||||
reviewRegistrationRequest: RegistrationRequest;
|
||||
reviewRewardWithdrawal: RewardWithdrawalRequest;
|
||||
startOrderWork: Order;
|
||||
submitCalculationOrder: Order;
|
||||
submitReadyOrder: Order;
|
||||
};
|
||||
|
||||
|
||||
export type MutationAcceptInvitationArgs = {
|
||||
input: AcceptInvitationInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationAddBonusTransactionArgs = {
|
||||
input: AddBonusTransactionInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationBlockOrderArgs = {
|
||||
input: BlockOrderInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationClientReviewOrderArgs = {
|
||||
decision: Decision;
|
||||
orderId: Scalars['ID']['input'];
|
||||
};
|
||||
|
||||
|
||||
export type MutationCompleteOrderArgs = {
|
||||
orderId: Scalars['ID']['input'];
|
||||
};
|
||||
|
||||
|
||||
export type MutationConnectMessengerArgs = {
|
||||
input: ConnectMessengerInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateInvitationArgs = {
|
||||
input: CreateInvitationInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateReferralArgs = {
|
||||
input: CreateReferralInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationManagerFinalizeOrderArgs = {
|
||||
decision: Decision;
|
||||
orderId: Scalars['ID']['input'];
|
||||
};
|
||||
|
||||
|
||||
export type MutationManagerSetOrderOfferArgs = {
|
||||
input: SetOrderOfferInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationRegisterSelfArgs = {
|
||||
input: RegisterSelfInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationRequestRewardWithdrawalArgs = {
|
||||
input: RequestRewardWithdrawalInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationReviewRegistrationRequestArgs = {
|
||||
input: ReviewRegistrationRequestInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationReviewRewardWithdrawalArgs = {
|
||||
input: ReviewRewardWithdrawalInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationStartOrderWorkArgs = {
|
||||
orderId: Scalars['ID']['input'];
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubmitCalculationOrderArgs = {
|
||||
input: SubmitCalculationOrderInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationSubmitReadyOrderArgs = {
|
||||
input: SubmitReadyOrderInput;
|
||||
};
|
||||
|
||||
export type Order = {
|
||||
__typename?: 'Order';
|
||||
blockReason?: Maybe<Scalars['String']['output']>;
|
||||
calculationPayload?: Maybe<Scalars['JSON']['output']>;
|
||||
clientApproved?: Maybe<Scalars['Boolean']['output']>;
|
||||
code: Scalars['String']['output'];
|
||||
createdAt: Scalars['DateTime']['output'];
|
||||
customerId: Scalars['ID']['output'];
|
||||
deliveryFee?: Maybe<Scalars['Float']['output']>;
|
||||
deliveryTerms?: Maybe<Scalars['String']['output']>;
|
||||
history: Array<OrderStatusEvent>;
|
||||
id: Scalars['ID']['output'];
|
||||
items: Array<OrderItem>;
|
||||
kind: OrderKind;
|
||||
managerApproved?: Maybe<Scalars['Boolean']['output']>;
|
||||
managerId?: Maybe<Scalars['ID']['output']>;
|
||||
status: OrderStatus;
|
||||
totalPrice?: Maybe<Scalars['Float']['output']>;
|
||||
updatedAt: Scalars['DateTime']['output'];
|
||||
};
|
||||
|
||||
export type OrderItem = {
|
||||
__typename?: 'OrderItem';
|
||||
id: Scalars['ID']['output'];
|
||||
productId?: Maybe<Scalars['ID']['output']>;
|
||||
productName: Scalars['String']['output'];
|
||||
quantity: Scalars['Float']['output'];
|
||||
};
|
||||
|
||||
export enum OrderKind {
|
||||
Calculation = 'CALCULATION',
|
||||
Ready = 'READY'
|
||||
}
|
||||
|
||||
export enum OrderStatus {
|
||||
ClientRejected = 'CLIENT_REJECTED',
|
||||
Completed = 'COMPLETED',
|
||||
Confirmed = 'CONFIRMED',
|
||||
InProgress = 'IN_PROGRESS',
|
||||
ManagerBlocked = 'MANAGER_BLOCKED',
|
||||
ManagerProcessing = 'MANAGER_PROCESSING',
|
||||
ManagerRejected = 'MANAGER_REJECTED',
|
||||
New = 'NEW',
|
||||
WaitingDoubleConfirm = 'WAITING_DOUBLE_CONFIRM'
|
||||
}
|
||||
|
||||
export type OrderStatusEvent = {
|
||||
__typename?: 'OrderStatusEvent';
|
||||
actorUserId: Scalars['ID']['output'];
|
||||
createdAt: Scalars['DateTime']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
note?: Maybe<Scalars['String']['output']>;
|
||||
status: OrderStatus;
|
||||
};
|
||||
|
||||
export type Product = {
|
||||
__typename?: 'Product';
|
||||
availableInWarehouses: Array<ProductWarehouseBalance>;
|
||||
description?: Maybe<Scalars['String']['output']>;
|
||||
id: Scalars['ID']['output'];
|
||||
isActive: Scalars['Boolean']['output'];
|
||||
isCustomizable: Scalars['Boolean']['output'];
|
||||
name: Scalars['String']['output'];
|
||||
sku: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export type ProductWarehouseBalance = {
|
||||
__typename?: 'ProductWarehouseBalance';
|
||||
availableQty: Scalars['Float']['output'];
|
||||
warehouse: Warehouse;
|
||||
};
|
||||
|
||||
export type Query = {
|
||||
__typename?: 'Query';
|
||||
clientProducts: Array<Product>;
|
||||
healthcheck: Scalars['String']['output'];
|
||||
managerOrders: Array<Order>;
|
||||
me?: Maybe<User>;
|
||||
myCurrentOrders: Array<Order>;
|
||||
myOrders: Array<Order>;
|
||||
referralStats: ReferralStats;
|
||||
registrationRequests: Array<RegistrationRequest>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryManagerOrdersArgs = {
|
||||
status?: InputMaybe<OrderStatus>;
|
||||
};
|
||||
|
||||
|
||||
export type QueryRegistrationRequestsArgs = {
|
||||
status?: InputMaybe<RegistrationStatus>;
|
||||
};
|
||||
|
||||
export type ReadyOrderItemInput = {
|
||||
productId: Scalars['ID']['input'];
|
||||
quantity: Scalars['Float']['input'];
|
||||
};
|
||||
|
||||
export type ReferralLink = {
|
||||
__typename?: 'ReferralLink';
|
||||
createdAt: Scalars['DateTime']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
refereeId: Scalars['ID']['output'];
|
||||
referrerId: Scalars['ID']['output'];
|
||||
};
|
||||
|
||||
export type ReferralStats = {
|
||||
__typename?: 'ReferralStats';
|
||||
availableBalance: Scalars['Float']['output'];
|
||||
pendingWithdrawals: Array<RewardWithdrawalRequest>;
|
||||
referralsCount: Scalars['Int']['output'];
|
||||
referrerId: Scalars['ID']['output'];
|
||||
transactions: Array<BonusTransaction>;
|
||||
};
|
||||
|
||||
export type RegisterSelfInput = {
|
||||
companyName: Scalars['String']['input'];
|
||||
contactName: Scalars['String']['input'];
|
||||
email: Scalars['String']['input'];
|
||||
inn?: InputMaybe<Scalars['String']['input']>;
|
||||
};
|
||||
|
||||
export type RegistrationRequest = {
|
||||
__typename?: 'RegistrationRequest';
|
||||
companyName: Scalars['String']['output'];
|
||||
contactName: Scalars['String']['output'];
|
||||
createdAt: Scalars['DateTime']['output'];
|
||||
email: Scalars['String']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
inn?: Maybe<Scalars['String']['output']>;
|
||||
rejectionReason?: Maybe<Scalars['String']['output']>;
|
||||
reviewedById?: Maybe<Scalars['ID']['output']>;
|
||||
status: RegistrationStatus;
|
||||
updatedAt: Scalars['DateTime']['output'];
|
||||
};
|
||||
|
||||
export enum RegistrationStatus {
|
||||
Approved = 'APPROVED',
|
||||
Pending = 'PENDING',
|
||||
Rejected = 'REJECTED'
|
||||
}
|
||||
|
||||
export type RequestRewardWithdrawalInput = {
|
||||
amount: Scalars['Float']['input'];
|
||||
};
|
||||
|
||||
export type ReviewRegistrationRequestInput = {
|
||||
decision: Decision;
|
||||
rejectionReason?: InputMaybe<Scalars['String']['input']>;
|
||||
requestId: Scalars['ID']['input'];
|
||||
};
|
||||
|
||||
export type ReviewRewardWithdrawalInput = {
|
||||
decision: Decision;
|
||||
reviewComment?: InputMaybe<Scalars['String']['input']>;
|
||||
withdrawalId: Scalars['ID']['input'];
|
||||
};
|
||||
|
||||
export type RewardWithdrawalRequest = {
|
||||
__typename?: 'RewardWithdrawalRequest';
|
||||
amount: Scalars['Float']['output'];
|
||||
createdAt: Scalars['DateTime']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
requesterId: Scalars['ID']['output'];
|
||||
reviewComment?: Maybe<Scalars['String']['output']>;
|
||||
reviewedById?: Maybe<Scalars['ID']['output']>;
|
||||
status: WithdrawalStatus;
|
||||
updatedAt: Scalars['DateTime']['output'];
|
||||
};
|
||||
|
||||
export type SetOrderOfferInput = {
|
||||
deliveryFee: Scalars['Float']['input'];
|
||||
deliveryTerms: Scalars['String']['input'];
|
||||
orderId: Scalars['ID']['input'];
|
||||
totalPrice: Scalars['Float']['input'];
|
||||
};
|
||||
|
||||
export type SubmitCalculationOrderInput = {
|
||||
parameters: Scalars['JSON']['input'];
|
||||
productName: Scalars['String']['input'];
|
||||
quantity: Scalars['Float']['input'];
|
||||
};
|
||||
|
||||
export type SubmitReadyOrderInput = {
|
||||
items: Array<ReadyOrderItemInput>;
|
||||
};
|
||||
|
||||
export type User = {
|
||||
__typename?: 'User';
|
||||
company?: Maybe<Company>;
|
||||
email: Scalars['String']['output'];
|
||||
fullName: Scalars['String']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
role: UserRole;
|
||||
};
|
||||
|
||||
export enum UserRole {
|
||||
Client = 'CLIENT',
|
||||
Manager = 'MANAGER'
|
||||
}
|
||||
|
||||
export type Warehouse = {
|
||||
__typename?: 'Warehouse';
|
||||
code: Scalars['String']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
name: Scalars['String']['output'];
|
||||
};
|
||||
|
||||
export enum WithdrawalStatus {
|
||||
Approved = 'APPROVED',
|
||||
Pending = 'PENDING',
|
||||
Rejected = 'REJECTED'
|
||||
}
|
||||
|
||||
export type RegisterSelfMutationVariables = Exact<{
|
||||
input: RegisterSelfInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type RegisterSelfMutation = { __typename?: 'Mutation', registerSelf: { __typename?: 'RegistrationRequest', id: string, companyName: string, contactName: string, email: string, status: RegistrationStatus, createdAt: any } };
|
||||
|
||||
export type ClientProductsQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type ClientProductsQuery = { __typename?: 'Query', clientProducts: Array<{ __typename?: 'Product', id: string, sku: string, name: string, description?: string | null, isCustomizable: boolean, availableInWarehouses: Array<{ __typename?: 'ProductWarehouseBalance', availableQty: number, warehouse: { __typename?: 'Warehouse', id: string, code: string, name: string } }> }> };
|
||||
|
||||
export type MyCurrentOrdersQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type MyCurrentOrdersQuery = { __typename?: 'Query', myCurrentOrders: Array<{ __typename?: 'Order', id: string, code: string, kind: OrderKind, status: OrderStatus, createdAt: any, items: Array<{ __typename?: 'OrderItem', id: string, productName: string, quantity: number }> }> };
|
||||
|
||||
export type MyOrdersQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type MyOrdersQuery = { __typename?: 'Query', myOrders: Array<{ __typename?: 'Order', id: string, code: string, kind: OrderKind, status: OrderStatus, totalPrice?: number | null, deliveryTerms?: string | null, createdAt: any, items: Array<{ __typename?: 'OrderItem', id: string, productName: string, quantity: number }> }> };
|
||||
|
||||
export type SubmitCalculationOrderMutationVariables = Exact<{
|
||||
input: SubmitCalculationOrderInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type SubmitCalculationOrderMutation = { __typename?: 'Mutation', submitCalculationOrder: { __typename?: 'Order', id: string, code: string, status: OrderStatus, createdAt: any } };
|
||||
|
||||
export type SubmitReadyOrderMutationVariables = Exact<{
|
||||
input: SubmitReadyOrderInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type SubmitReadyOrderMutation = { __typename?: 'Mutation', submitReadyOrder: { __typename?: 'Order', id: string, code: string, status: OrderStatus, createdAt: any } };
|
||||
|
||||
export type ConnectMessengerMutationVariables = Exact<{
|
||||
input: ConnectMessengerInput;
|
||||
}>;
|
||||
|
||||
|
||||
export type ConnectMessengerMutation = { __typename?: 'Mutation', connectMessenger: { __typename?: 'MessengerConnection', id: string, type: MessengerType, channelId: string, isActive: boolean } };
|
||||
|
||||
|
||||
export const RegisterSelfDocument = gql`
|
||||
mutation RegisterSelf($input: RegisterSelfInput!) {
|
||||
registerSelf(input: $input) {
|
||||
id
|
||||
companyName
|
||||
contactName
|
||||
email
|
||||
status
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useRegisterSelfMutation__
|
||||
*
|
||||
* To run a mutation, you first call `useRegisterSelfMutation` within a Vue component and pass it any options that fit your needs.
|
||||
* When your component renders, `useRegisterSelfMutation` returns an object that includes:
|
||||
* - A mutate function that you can call at any time to execute the mutation
|
||||
* - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return
|
||||
*
|
||||
* @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options;
|
||||
*
|
||||
* @example
|
||||
* const { mutate, loading, error, onDone } = useRegisterSelfMutation({
|
||||
* variables: {
|
||||
* input: // value for 'input'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useRegisterSelfMutation(options: VueApolloComposable.UseMutationOptions<RegisterSelfMutation, RegisterSelfMutationVariables> | ReactiveFunction<VueApolloComposable.UseMutationOptions<RegisterSelfMutation, RegisterSelfMutationVariables>> = {}) {
|
||||
return VueApolloComposable.useMutation<RegisterSelfMutation, RegisterSelfMutationVariables>(RegisterSelfDocument, options);
|
||||
}
|
||||
export type RegisterSelfMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn<RegisterSelfMutation, RegisterSelfMutationVariables>;
|
||||
export const ClientProductsDocument = gql`
|
||||
query ClientProducts {
|
||||
clientProducts {
|
||||
id
|
||||
sku
|
||||
name
|
||||
description
|
||||
isCustomizable
|
||||
availableInWarehouses {
|
||||
availableQty
|
||||
warehouse {
|
||||
id
|
||||
code
|
||||
name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useClientProductsQuery__
|
||||
*
|
||||
* To run a query within a Vue component, call `useClientProductsQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useClientProductsQuery` returns an object from Apollo Client that contains result, loading and error properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;
|
||||
*
|
||||
* @example
|
||||
* const { result, loading, error } = useClientProductsQuery();
|
||||
*/
|
||||
export function useClientProductsQuery(options: VueApolloComposable.UseQueryOptions<ClientProductsQuery, ClientProductsQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<ClientProductsQuery, ClientProductsQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<ClientProductsQuery, ClientProductsQueryVariables>> = {}) {
|
||||
return VueApolloComposable.useQuery<ClientProductsQuery, ClientProductsQueryVariables>(ClientProductsDocument, {}, options);
|
||||
}
|
||||
export function useClientProductsLazyQuery(options: VueApolloComposable.UseQueryOptions<ClientProductsQuery, ClientProductsQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<ClientProductsQuery, ClientProductsQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<ClientProductsQuery, ClientProductsQueryVariables>> = {}) {
|
||||
return VueApolloComposable.useLazyQuery<ClientProductsQuery, ClientProductsQueryVariables>(ClientProductsDocument, {}, options);
|
||||
}
|
||||
export type ClientProductsQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<ClientProductsQuery, ClientProductsQueryVariables>;
|
||||
export const MyCurrentOrdersDocument = gql`
|
||||
query MyCurrentOrders {
|
||||
myCurrentOrders {
|
||||
id
|
||||
code
|
||||
kind
|
||||
status
|
||||
createdAt
|
||||
items {
|
||||
id
|
||||
productName
|
||||
quantity
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useMyCurrentOrdersQuery__
|
||||
*
|
||||
* To run a query within a Vue component, call `useMyCurrentOrdersQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useMyCurrentOrdersQuery` returns an object from Apollo Client that contains result, loading and error properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;
|
||||
*
|
||||
* @example
|
||||
* const { result, loading, error } = useMyCurrentOrdersQuery();
|
||||
*/
|
||||
export function useMyCurrentOrdersQuery(options: VueApolloComposable.UseQueryOptions<MyCurrentOrdersQuery, MyCurrentOrdersQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<MyCurrentOrdersQuery, MyCurrentOrdersQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<MyCurrentOrdersQuery, MyCurrentOrdersQueryVariables>> = {}) {
|
||||
return VueApolloComposable.useQuery<MyCurrentOrdersQuery, MyCurrentOrdersQueryVariables>(MyCurrentOrdersDocument, {}, options);
|
||||
}
|
||||
export function useMyCurrentOrdersLazyQuery(options: VueApolloComposable.UseQueryOptions<MyCurrentOrdersQuery, MyCurrentOrdersQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<MyCurrentOrdersQuery, MyCurrentOrdersQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<MyCurrentOrdersQuery, MyCurrentOrdersQueryVariables>> = {}) {
|
||||
return VueApolloComposable.useLazyQuery<MyCurrentOrdersQuery, MyCurrentOrdersQueryVariables>(MyCurrentOrdersDocument, {}, options);
|
||||
}
|
||||
export type MyCurrentOrdersQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<MyCurrentOrdersQuery, MyCurrentOrdersQueryVariables>;
|
||||
export const MyOrdersDocument = gql`
|
||||
query MyOrders {
|
||||
myOrders {
|
||||
id
|
||||
code
|
||||
kind
|
||||
status
|
||||
totalPrice
|
||||
deliveryTerms
|
||||
createdAt
|
||||
items {
|
||||
id
|
||||
productName
|
||||
quantity
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useMyOrdersQuery__
|
||||
*
|
||||
* To run a query within a Vue component, call `useMyOrdersQuery` and pass it any options that fit your needs.
|
||||
* When your component renders, `useMyOrdersQuery` returns an object from Apollo Client that contains result, loading and error properties
|
||||
* you can use to render your UI.
|
||||
*
|
||||
* @param options that will be passed into the query, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/query.html#options;
|
||||
*
|
||||
* @example
|
||||
* const { result, loading, error } = useMyOrdersQuery();
|
||||
*/
|
||||
export function useMyOrdersQuery(options: VueApolloComposable.UseQueryOptions<MyOrdersQuery, MyOrdersQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<MyOrdersQuery, MyOrdersQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<MyOrdersQuery, MyOrdersQueryVariables>> = {}) {
|
||||
return VueApolloComposable.useQuery<MyOrdersQuery, MyOrdersQueryVariables>(MyOrdersDocument, {}, options);
|
||||
}
|
||||
export function useMyOrdersLazyQuery(options: VueApolloComposable.UseQueryOptions<MyOrdersQuery, MyOrdersQueryVariables> | VueCompositionApi.Ref<VueApolloComposable.UseQueryOptions<MyOrdersQuery, MyOrdersQueryVariables>> | ReactiveFunction<VueApolloComposable.UseQueryOptions<MyOrdersQuery, MyOrdersQueryVariables>> = {}) {
|
||||
return VueApolloComposable.useLazyQuery<MyOrdersQuery, MyOrdersQueryVariables>(MyOrdersDocument, {}, options);
|
||||
}
|
||||
export type MyOrdersQueryCompositionFunctionResult = VueApolloComposable.UseQueryReturn<MyOrdersQuery, MyOrdersQueryVariables>;
|
||||
export const SubmitCalculationOrderDocument = gql`
|
||||
mutation SubmitCalculationOrder($input: SubmitCalculationOrderInput!) {
|
||||
submitCalculationOrder(input: $input) {
|
||||
id
|
||||
code
|
||||
status
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useSubmitCalculationOrderMutation__
|
||||
*
|
||||
* To run a mutation, you first call `useSubmitCalculationOrderMutation` within a Vue component and pass it any options that fit your needs.
|
||||
* When your component renders, `useSubmitCalculationOrderMutation` returns an object that includes:
|
||||
* - A mutate function that you can call at any time to execute the mutation
|
||||
* - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return
|
||||
*
|
||||
* @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options;
|
||||
*
|
||||
* @example
|
||||
* const { mutate, loading, error, onDone } = useSubmitCalculationOrderMutation({
|
||||
* variables: {
|
||||
* input: // value for 'input'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useSubmitCalculationOrderMutation(options: VueApolloComposable.UseMutationOptions<SubmitCalculationOrderMutation, SubmitCalculationOrderMutationVariables> | ReactiveFunction<VueApolloComposable.UseMutationOptions<SubmitCalculationOrderMutation, SubmitCalculationOrderMutationVariables>> = {}) {
|
||||
return VueApolloComposable.useMutation<SubmitCalculationOrderMutation, SubmitCalculationOrderMutationVariables>(SubmitCalculationOrderDocument, options);
|
||||
}
|
||||
export type SubmitCalculationOrderMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn<SubmitCalculationOrderMutation, SubmitCalculationOrderMutationVariables>;
|
||||
export const SubmitReadyOrderDocument = gql`
|
||||
mutation SubmitReadyOrder($input: SubmitReadyOrderInput!) {
|
||||
submitReadyOrder(input: $input) {
|
||||
id
|
||||
code
|
||||
status
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useSubmitReadyOrderMutation__
|
||||
*
|
||||
* To run a mutation, you first call `useSubmitReadyOrderMutation` within a Vue component and pass it any options that fit your needs.
|
||||
* When your component renders, `useSubmitReadyOrderMutation` returns an object that includes:
|
||||
* - A mutate function that you can call at any time to execute the mutation
|
||||
* - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return
|
||||
*
|
||||
* @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options;
|
||||
*
|
||||
* @example
|
||||
* const { mutate, loading, error, onDone } = useSubmitReadyOrderMutation({
|
||||
* variables: {
|
||||
* input: // value for 'input'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useSubmitReadyOrderMutation(options: VueApolloComposable.UseMutationOptions<SubmitReadyOrderMutation, SubmitReadyOrderMutationVariables> | ReactiveFunction<VueApolloComposable.UseMutationOptions<SubmitReadyOrderMutation, SubmitReadyOrderMutationVariables>> = {}) {
|
||||
return VueApolloComposable.useMutation<SubmitReadyOrderMutation, SubmitReadyOrderMutationVariables>(SubmitReadyOrderDocument, options);
|
||||
}
|
||||
export type SubmitReadyOrderMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn<SubmitReadyOrderMutation, SubmitReadyOrderMutationVariables>;
|
||||
export const ConnectMessengerDocument = gql`
|
||||
mutation ConnectMessenger($input: ConnectMessengerInput!) {
|
||||
connectMessenger(input: $input) {
|
||||
id
|
||||
type
|
||||
channelId
|
||||
isActive
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
/**
|
||||
* __useConnectMessengerMutation__
|
||||
*
|
||||
* To run a mutation, you first call `useConnectMessengerMutation` within a Vue component and pass it any options that fit your needs.
|
||||
* When your component renders, `useConnectMessengerMutation` returns an object that includes:
|
||||
* - A mutate function that you can call at any time to execute the mutation
|
||||
* - Several other properties: https://v4.apollo.vuejs.org/api/use-mutation.html#return
|
||||
*
|
||||
* @param options that will be passed into the mutation, supported options are listed on: https://v4.apollo.vuejs.org/guide-composable/mutation.html#options;
|
||||
*
|
||||
* @example
|
||||
* const { mutate, loading, error, onDone } = useConnectMessengerMutation({
|
||||
* variables: {
|
||||
* input: // value for 'input'
|
||||
* },
|
||||
* });
|
||||
*/
|
||||
export function useConnectMessengerMutation(options: VueApolloComposable.UseMutationOptions<ConnectMessengerMutation, ConnectMessengerMutationVariables> | ReactiveFunction<VueApolloComposable.UseMutationOptions<ConnectMessengerMutation, ConnectMessengerMutationVariables>> = {}) {
|
||||
return VueApolloComposable.useMutation<ConnectMessengerMutation, ConnectMessengerMutationVariables>(ConnectMessengerDocument, options);
|
||||
}
|
||||
export type ConnectMessengerMutationCompositionFunctionResult = VueApolloComposable.UseMutationReturn<ConnectMessengerMutation, ConnectMessengerMutationVariables>;
|
||||
5
app/composables/useGqlClient.ts
Normal file
5
app/composables/useGqlClient.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import type { ApolloClient, NormalizedCacheObject } from '@apollo/client/core';
|
||||
|
||||
export function useGqlClient(): ApolloClient<NormalizedCacheObject> {
|
||||
return useNuxtApp().$apollo as ApolloClient<NormalizedCacheObject>;
|
||||
}
|
||||
Reference in New Issue
Block a user