Skip to main content

RelatedProducts

Returns products related to the inputted courses and products. Related products are configured in course authoring -> design tab -> edit catalog settings -> detail page.

RelatedProducts(
productIds: [ID!]!
courseIds: [ID!]!
): [Product!]!

Arguments

RelatedProducts.productIds ● [ID!]! non-null scalar

RelatedProducts.courseIds ● [ID!]! non-null scalar

Type

Product object

Examples

Run in Postman

Query:

RelatedProducts(
$productIds: [ID!]!,
$courseIds: [ID!]!
) {
RelatedProducts(
productIds: $productIds,
courseIds: $courseIds
) {
id
asset
status
purchasable
name
longDescription
priceInCents
language
suggestedRetailPriceInCents
alternativePricingType
alternativePricingRef
relatedProducts {
...ProductFragment
}
}
}

Variables:

{
"productIds": [
"58ccb96c-8e90-4464-86e0-f284442981df"
],
"courseIds": [
"58ccb96c-8e90-4464-86e0-f284442981df"
]
}

Response:

{
"data": {
"RelatedProducts": [
{
"id": "58ccb96c-8e90-4464-86e0-f284442981df",
"asset": "URL",
"status": "draft",
"purchasable": true,
"name": "abc123",
"longDescription": "xyz789",
"priceInCents": 678,
"language": "abc123",
"suggestedRetailPriceInCents": 678,
"alternativePricingType": "membership",
"alternativePricingRef": 678,
"relatedProducts": [
"Product"
]
}
]
}
}