import { ApolloQueryResult } from '@apollo/client/core' ; import { CustomQuery } from '@vue-storefront/core' ; import { CategorySearchQuery , CategorySearchQueryVariables } from '../../types/GraphQL' ; import categorySearch from './categorySearch' ; import { Context } from '../../types/context' ; export default async ( context , filters , customQuery = { categorySearch : 'categorySearch' } ) : Promise < ApolloQueryResult < CategorySearchQuery > > => { const { categorySearch : categorySearchGQL } = context . extendQuery ( customQuery , { categorySearch : { query : categorySearch , variables : { ... filters } , } , } ) ; return context . client . query < CategorySearchQuery , CategorySearchQueryVariables > ( { query : categorySearchGQL . query , variables : categorySearchGQL . variables , } ) ; } ;