27 lines
562 B
TypeScript

import type { ApolloClient } from '@apollo/client';
import { gql } from '@apollo/client';
import type { GetBrandsQuery } from 'graphql/crm.types';
const QUERY_GET_BRANDS = gql`
query GetBrands {
selectBrand: evo_brands(statecode: 0) {
label: evo_name
value: evo_brandid
}
}
`;
export default async function getBrands(apolloClient: ApolloClient<object>) {
const {
data: { selectBrand },
} = await apolloClient.query<GetBrandsQuery>({
query: QUERY_GET_BRANDS,
});
return {
options: {
selectBrand,
},
};
}