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
Field | Type | Nullable | Description | Related Type |
---|---|---|---|---|
id | Int | Yes | Returns the id of the review. | |
name | String | Yes | Returns the name of the reviewer. | |
customer | Customer | Yes | Returns the customer who wrote the review, or null if anonymous. | Customer |
title | String | Yes | Returns the title of the review. | |
review | String | Yes | Returns the detailed text of the review. | |
rating | Int | Yes | Returns the rating given by the reviewer. | |
maxRating | Int | Yes | Returns the maximum possible rating value. | |
createdAt | String | Yes | Returns the ISO 8601 date when the review was created. | |
updatedAt | String | Yes | Returns 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 benull
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.
Related Types
- Customer: Represents the user who submitted the review. Accessible via the
customer
field onReview
.
Best Practices
- When querying reviews, select only the fields you need to optimize response size and performance.
- Use the
createdAt
andupdatedAt
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
, orreview
may be null. - For rating displays, use both
rating
andmaxRating
to calculate relative scores or star ratings.
Notes
- All fields on
Review
are optional and may returnnull
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.