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) { const { data: { selectBrand }, } = await apolloClient.query({ query: QUERY_GET_BRANDS, }); return { options: { selectBrand, }, }; }