Skip to main content
A review stores no foreign keys. Four module links in packages/core/src/links/ connect it to the records around it, and query.graph follows them by alias. Every link is a list link on the other module’s side: one product, seller, order, or customer has many reviews, and each review has one of each it’s linked to.
This loads published reviews with their target and order. Only one of product and seller is set on each review.

Product and review

Connects a master product to its product reviews. Written by createReviewWorkflow through the create-remote-links step when reference is product.

Seller and review

Connects a seller to its store reviews. Written by createReviewWorkflow through the create-remote-links step when reference is seller. The Vendor API scopes reviews to a store through this link.

Order and review

Connects a review to the order that earned it. Written for every review by the create-review step. createReviewWorkflow reads it to reject a second review of the same target from one order.

Customer and review

Connects a review to the customer who wrote it. Written for every review by the create-review step. The Store API limits a customer to their own reviews through this link.
deleteReviewWorkflow soft deletes the review but keeps all of its link rows. The service’s rating helpers join through the product and seller link tables, so they still count a soft deleted review.