Skip to Content

Review

Describes a product review.

Type Definition

type Review { id: Int name: String customer: Customer title: String review: String rating: Int maxRating: Int createdAt: String updatedAt: String }

Fields

FieldTypeNullableDescriptionRelated Type
idIntYesReturns the id of the review.
nameStringYesReturns the name of the reviewer.
customerCustomerYesReturns the customer who wrote the review, or null if anonymous.Customer
titleStringYesReturns the title of the review.
reviewStringYesReturns the detailed text of the review.
ratingIntYesReturns the rating given by the reviewer.
maxRatingIntYesReturns the maximum possible rating value.
createdAtStringYesReturns the ISO 8601 date when the review was created.
updatedAtStringYesReturns the ISO 8601 date when the review was last updated.

Relationships

  • customer: Links the review to a Customer object representing the user who submitted the review. This field may be null if the review was submitted anonymously or the customer data is unavailable.

Usage Examples

Basic Query

{ review(id: 12345) { id name title review rating maxRating createdAt } }

Field Selection

{ review(id: 12345) { title rating maxRating } }

Nested Queries

{ review(id: 12345) { id title review rating customer { id name email } } }

Filtering and Sorting

The Review object itself does not define filtering or sorting fields directly. However, when querying collections of reviews (e.g., via a query returning multiple reviews), you can typically filter or sort by fields such as rating, createdAt, or updatedAt depending on the API’s query capabilities.

Example of filtering reviews with rating greater than or equal to 4 and sorting by creation date descending (assuming the query supports these arguments):

{ reviews(filter: { rating_gte: 4 }, sort: CREATED_AT_DESC, first: 10) { edges { node { id title rating createdAt } } } }

Note: Adjust filtering and sorting syntax according to the actual query schema.

Implements

The Review type does not explicitly implement any interfaces.

Connections

No connection fields are defined on the Review type itself. Pagination and connection handling are expected to be managed by the parent query or collection fields returning Review objects.

  • Customer: Represents the user who submitted the review. Accessible via the customer field on Review.

Best Practices

  • When querying reviews, select only the fields you need to optimize response size and performance.
  • Use the createdAt and updatedAt fields to sort or filter reviews by recency.
  • To display reviewer information, check if the customer field is non-null before accessing nested customer data.
  • Handle cases where optional fields like name, title, or review may be null.
  • For rating displays, use both rating and maxRating to calculate relative scores or star ratings.

Notes

  • All fields on Review are optional and may return null if data is unavailable.
  • Dates (createdAt, updatedAt) are returned as ISO 8601 formatted strings.
  • The API currently requires no authentication, but this may change in future versions.
  • Consider caching review queries where appropriate to improve performance, especially for frequently accessed product reviews.
  • No computed or derived fields are defined on Review.
  • No field arguments are defined on the Review fields themselves. Filtering and pagination are handled at the query level.

For any questions or further assistance, please refer to the API schema or contact the API support team.

Last updated on