Skip to content

indarsl/reviews-graphql

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

ScandiPWA_ReviewsGraphQl

ReviewsGraphQl provides basic types and resolvers for adding and displaying customer reviews.

Module also adds a new field to ProductInterface:

  • review_summary which includes information about product reviews:

    • rating_summary,

    • review_count.

addProductReview

mutation AddProductReview($productReviewItem: ProductReviewInput!) {
    addProductReview(productReviewItem: $productReviewItem) {
        review_id
        entity_id
        entity_pk_value
        status_id
        store_id
        customer_id
        nickname
        title
        detail
        created_at
    }
}
{
    "productReviewItem": {
        "nickname": "John",
        "title": "Review Title",
        "detail": "Review Detail",
        "product_sku": "n31191497",
        "rating_data":[
            {
              "rating_id": 1,
              "option_id": 4
            },{
              "rating_id": 2,
              "option_id": 8
            }
        ]
    }
}

getProductReviews

query GetProductReviews($product_sku: String!) {
    getProductReviews(product_sku: $product_sku) {
        review_id
        entity_id
        entity_code
        entity_pk_value
        status_id
        customer_id
        nickname
        title
        detail_id
        detail
        created_at
        rating_votes {
            vote_id
            option_id
            remote_ip
            remote_ip_long
            customer_id
            entity_pk_value
            rating_id
            review_id
            percent
            value
            rating_code
            store_id
        }
    }
}
{
    "product_sku": "n31191497"
}

About

Reviews GraphQL endpoints for M2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • PHP 100.0%