Home > @vue-storefront/magento-api > relatedProduct
relatedProduct() function
Searches for related products using params for sorting, filtering and pagination.
Signature:
export default function relatedProduct(context: Context, searchParams?: GetProductSearchParams, customQuery?: CustomQuery, customHeaders?: CustomHeaders): Promise<ApolloQueryResult<RelatedProductQuery>>;
Parameters
Parameter | Type | Description |
---|---|---|
context | Context | VSF context |
searchParams | GetProductSearchParams | (Optional) params for sorting, filtering and pagination |
customQuery | CustomQuery | (Optional) (optional) - custom GraphQL query that extends the default query |
customHeaders | CustomHeaders | (Optional) (optional) - custom headers that extends the default headers |
Returns:
Promise<ApolloQueryResult<RelatedProductQuery>>