So I’ve been on the Shopify Storefront docs and I found this.
I looks like I can get recommended products by providing a product id.
I’ve written the query below, but it always returns an empty array:
import { gql } from '@ts-gql/tag';
import type { Client } from '../utils/apollo-client';
export const PRODUCT_RECOMMENDATIONS = gql`
query productRecommendations(
$productId: ID!
$variantsFirst: Int = 1
$imagesFirst: Int = 5
) {
productRecommendations(productId: $productId) {
description
handle
id
images(first: $imagesFirst) {
edges {
node {
id
originalSrc
altText
}
}
}
priceRange {
maxVariantPrice {
amount
}
minVariantPrice {
amount
}
}
productType
tags
title
variants(first: $variantsFirst) {
edges {
node {
sku
availableForSale
id
compareAtPriceV2 {
amount
currencyCode
}
priceV2 {
amount
currencyCode
}
title
image {
id
originalSrc
altText
}
}
}
}
}
}
` as import('../../../__generated__/ts-gql/productRecommendations').type;
export type ProductRecommendations =
typeof PRODUCT_RECOMMENDATIONS['___type']['result']['productRecommendations'];
export async function getProductRecommendations(
client: Client,
productId: string,
variantsFirst?: number,
imagesFirst?: number
): Promise
Is this because I'm using the Shopify Lite plan? I'd really like to use this feature if possible for a headless Shopify site that I'm building with [Next.js](https://nextjs.org).