Magento 2 AI Review TranslatorMagento 2 AI Review Translator
Live Demo
Buy Now
Support
Live Demo
Buy Now
Support
  • Getting Started

    • Introduction
    • Key Features
    • How It Works
  • Installation

    • Requirements
    • Install the Module
    • Install the AI Packages
    • Enable & Compile
    • Verify the Installation
    • Content Security Policy
    • Translating the Interface
  • Setup

    • Enable the Module
    • Activate Your Licence
    • Select an LLM Provider
    • Validate & Load Models
    • First Translation
  • Configuration

    • Overview
    • General Settings
    • Limits & Timeouts
    • Store Views & Languages
    • Admin Menu
    • Access Control
  • LLM Providers

    • Provider Overview
    • How Validation Works
    • Choosing a Model
    • Switching Providers
  • Ollama (Self-Hosted)

    • Install Ollama
    • Connect to Magento
    • Timeouts & Batch Size
    • Troubleshooting
  • Translating Reviews

    • Translation Basics
    • What Is Sent to the Model
    • Fallback Behaviour
    • Automatic Translation
    • The Queue Consumer
    • Running the Consumer
    • Bulk CLI Command
    • Batch Size
    • CLI Output & Exit Codes
  • Storefront

    • On the Storefront
    • The Toggle
    • Styling
  • Developers

    • GraphQL API
    • Querying from Code
    • Data Model
    • Useful SQL
  • Help

    • Setup Problems
    • Translation Problems
    • Queue Problems
    • Storefront Problems
    • FAQ

GraphQL API

For PWA Studio or any headless storefront, one query returns both the original and the translated version of every approved review on a product.

Endpoint: https://<your-store>/graphql

The query

query {
  getTranslatedReview(productId: 1, storeId: 1) {
    review_id
    original_review {
      title
      detail
    }
    translated_review {
      title
      detail
    }
    store_id
    product_id
    language_code
    nickname
    customer_id
    created_at
  }
}

Arguments

ArgumentTypeRequiredNotes
productIdInt!YesCatalog product entity ID. 0 or missing raises Invalid Product.
storeIdInt!YesStore view whose translations you want. Defaults to 1 if omitted.

The response

{
  "data": {
    "getTranslatedReview": [
      {
        "review_id": 1,
        "original_review": {
          "title": "test review",
          "detail": "hello from harsh"
        },
        "translated_review": {
          "title": "Test review",
          "detail": "Hello from Harsh.\n"
        },
        "store_id": 1,
        "product_id": 1,
        "language_code": "en_US",
        "nickname": "customer1",
        "customer_id": null,
        "created_at": "05/08/2025"
      }
    ]
  }
}

Fields

FieldTypeNotes
review_idIntMagento review ID.
original_reviewReviewContenttitle and detail as the customer wrote them.
translated_reviewReviewContentThe translation. Falls back to the original when a field is empty.
store_idIntEchoes the requested store view.
product_idIntEchoes the requested product.
language_codeStringLocale of the translation. Empty when untranslated.
nicknameStringReview author's display name.
customer_idIntnull for guest reviews.
created_atStringFormatted MM/DD/YYYY in the store's timezone.

Only approved reviews are returned.

Detecting an untranslated review

Compare translated_review against original_review, or check language_code — it is empty when no translation row exists.

Authentication

The query is public. No customer token is needed, matching Magento's own review data being public on the storefront.

Nickname and customer_id are returned unauthenticated

Both are already visible on the storefront, but if your policy is stricter, do not expose this query through a public gateway without filtering the response.

Errors

MessageCause
Invalid Product.productId was 0 or absent.
Invalid RequestThe query was called with no arguments at all.

Schema

type Query {
    getTranslatedReview(productId: Int!, storeId: Int!): [TranslatedReviewDetailsType]
}

type TranslatedReviewDetailsType {
    review_id: Int
    original_review: ReviewContent
    translated_review: ReviewContent
    store_id: Int
    product_id: Int
    language_code: String
    nickname: String
    customer_id: Int
    created_at: String
}

type ReviewContent {
    title: String
    detail: String
}

Example calls are on Querying from Code.

Next
Querying from Code