Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

84 строки
5.7 KiB

  1. # Copyright © Magento, Inc. All rights reserved.
  2. # See COPYING.txt for license details.
  3. interface ProductInterface {
  4. rating_summary: Float! @doc(description: "The average of all the ratings given to the product.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Product\\RatingSummary")
  5. review_count: Int! @doc(description: "The total count of all the reviews given to the product.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Product\\ReviewCount")
  6. reviews(
  7. pageSize: Int = 20 @doc(description: "The maximum number of results to return at once. The default is 20."),
  8. currentPage: Int = 1 @doc(description: "The page of results to return. The default is 1."),
  9. ): ProductReviews! @doc(description: "The list of products reviews.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Product\\Reviews")
  10. }
  11. type ProductReviews @doc(description: "Contains an array of product reviews.") {
  12. items: [ProductReview]! @doc(description: "An array of product reviews.")
  13. page_info: SearchResultPageInfo! @doc(description: "Metadata for pagination rendering.")
  14. }
  15. type ProductReview @doc(description: "Contains details of a product review.") {
  16. product: ProductInterface! @doc(description: "The reviewed product.") @resolver(class: "Magento\\CatalogGraphQl\\Model\\Resolver\\Product")
  17. summary: String! @doc(description: "The summary (title) of the review.")
  18. text: String! @doc(description: "The review text.")
  19. nickname: String! @doc(description: "The customer's nickname. Defaults to the customer name, if logged in.")
  20. created_at: String! @doc(description: "The date the review was created.")
  21. average_rating: Float! @doc(description: "The average of all ratings for this product.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Product\\Review\\AverageRating")
  22. ratings_breakdown: [ProductReviewRating!]! @doc(description: "An array of ratings by rating category, such as quality, price, and value.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Product\\Review\\RatingBreakdown")
  23. }
  24. type ProductReviewRating @doc(description: "Contains data about a single aspect of a product review.") {
  25. name: String! @doc(description: "The label assigned to an aspect of a product that is being rated, such as quality or price.")
  26. value: String! @doc(description: "The rating value given by customer. By default, possible values range from 1 to 5.")
  27. }
  28. type Query {
  29. productReviewRatingsMetadata: ProductReviewRatingsMetadata! @doc(description: "Return the active ratings attributes and the values each rating can have.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\ProductReviewRatingsMetadata")
  30. }
  31. type ProductReviewRatingsMetadata @doc(description: "Contains an array of metadata about each aspect of a product review.") {
  32. items: [ProductReviewRatingMetadata!]! @doc(description: "An array of product reviews sorted by position.")
  33. }
  34. type ProductReviewRatingMetadata @doc(description: "Contains details about a single aspect of a product review.") {
  35. id: String! @doc(description: "An encoded rating ID.")
  36. name: String! @doc(description: "The label assigned to an aspect of a product that is being rated, such as quality or price.")
  37. values: [ProductReviewRatingValueMetadata!]! @doc(description: "List of product review ratings sorted by position.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\ProductReviewRatingValueMetadata")
  38. }
  39. type ProductReviewRatingValueMetadata @doc(description: "Contains details about a single value in a product review.") {
  40. value_id: String! @doc(description: "An encoded rating value ID.")
  41. value: String! @doc(description: "A ratings scale, such as the number of stars awarded.")
  42. }
  43. type Customer {
  44. reviews(
  45. pageSize: Int = 20 @doc(description: "The maximum number of results to return at once. The default value is 20."),
  46. currentPage: Int = 1 @doc(description: "The page of results to return. The default value is 1."),
  47. ): ProductReviews! @doc(description: "Contains the customer's product reviews.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\Customer\\Reviews")
  48. }
  49. type Mutation {
  50. createProductReview(input: CreateProductReviewInput! @doc(description: "An input object that contains the details necessary to create a product review.")): CreateProductReviewOutput! @doc(description: "Create a product review for the specified product.") @resolver(class: "Magento\\ReviewGraphQl\\Model\\Resolver\\CreateProductReview")
  51. }
  52. type CreateProductReviewOutput @doc(description: "Contains the completed product review.") {
  53. review: ProductReview! @doc(description: "Product review details.")
  54. }
  55. input CreateProductReviewInput @doc(description: "Defines a new product review.") {
  56. sku: String! @doc(description: "The SKU of the reviewed product.")
  57. nickname: String! @doc(description: "The customer's nickname. Defaults to the customer name, if logged in.")
  58. summary: String! @doc(description: "The summary (title) of the review.")
  59. text: String! @doc(description: "The review text.")
  60. ratings: [ProductReviewRatingInput!]! @doc(description: "The ratings details by category. For example, Price: 5 stars, Quality: 4 stars, etc.")
  61. }
  62. input ProductReviewRatingInput @doc(description: "Contains the reviewer's rating for a single aspect of a review.") {
  63. id: String! @doc(description: "An encoded rating ID.")
  64. value_id: String! @doc(description: "An encoded rating value ID.")
  65. }
  66. type StoreConfig {
  67. product_reviews_enabled : String @doc(description: "Indicates whether product reviews are enabled. Possible values: 1 (Yes) and 0 (No).")
  68. allow_guests_to_write_product_reviews : String @doc(description: "Indicates whether guest users can write product reviews. Possible values: 1 (Yes) and 0 (No).")
  69. }