22 lines
525 B
TypeScript
22 lines
525 B
TypeScript
'use server';
|
|
import { getClientWithToken } from '../apollo/client';
|
|
import * as GQL from '../types';
|
|
|
|
export async function getOrder(variables: GQL.GetOrderQueryVariables) {
|
|
const { query } = await getClientWithToken();
|
|
|
|
return query({
|
|
query: GQL.GetOrderDocument,
|
|
variables,
|
|
});
|
|
}
|
|
|
|
export async function createOrder(input: GQL.CreateOrderMutationVariables['input']) {
|
|
const { mutate } = await getClientWithToken();
|
|
|
|
return mutate({
|
|
mutation: GQL.CreateOrderDocument,
|
|
variables: { input },
|
|
});
|
|
}
|