2022-07-18 13:26:45 +03:00

27 lines
560 B
TypeScript

import type { ApolloClient } from '@apollo/client';
import { gql } from '@apollo/client';
import type { GetBrands } from './__generated__/GetBrands';
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<GetBrands>({
query: QUERY_GET_BRANDS,
});
return {
options: {
selectBrand,
},
};
}