PHPackages                             ashokdubariya/module-testimonial - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. ashokdubariya/module-testimonial

ActiveMagento2-module[API Development](/categories/api)

ashokdubariya/module-testimonial
================================

Magento 2 Testimonial Module with GraphQL API support and Hyvä Theme compatibility for managing customer testimonials with complete CRUD operations, admin panel, and frontend display.

1.0.0(5mo ago)132MITPHPPHP ^8.1

Since Jan 15Pushed 5mo agoCompare

[ Source](https://github.com/ashokdubariya/magento2-testimonial-graphql)[ Packagist](https://packagist.org/packages/ashokdubariya/module-testimonial)[ RSS](/packages/ashokdubariya-module-testimonial/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (3)Versions (2)Used By (0)

Magento 2 Testimonial Module with GraphQL APIs
==============================================

[](#magento-2-testimonial-module-with-graphql-apis)

This repository contains a **Testimonial** module with **GraphQL** API support and Hyvä Theme compatibility for managing customer testimonials with complete CRUD operations, admin panel, and frontend display.

Key Features
------------

[](#key-features)

- Complete database schema with optimized indexes
- Full Admin CRUD using Magento UI Components
- Frontend testimonial listing and submission pages
- GraphQL endpoints (queries &amp; mutations)
- Strong validation and security best practices
- LESS-based styling following Magento 2 standards (Luma)
- Hyvä theme compatible frontend (no RequireJS / no jQuery)
- Repository pattern and service layer architecture

Requirements
------------

[](#requirements)

- Magento Open Source **2.4.5+**
- PHP **8.1+**

Module Information
------------------

[](#module-information)

- **Module Name:** `Ashokdubariya_Testimonial`
- **Package Name:** `ashokdubariya/module-testimonial`
- **Module Type:** Magento 2 Custom Module
- **API Type:** GraphQL
- **License:** MIT

Installation
------------

[](#installation)

### Method 1: Composer Installation (Recommended)

[](#method-1-composer-installation-recommended)

```
composer require ashokdubariya/module-testimonial
php bin/magento module:enable Ashokdubariya_Testimonial
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
```

### Method 2: Manual Installation

[](#method-2-manual-installation)

1. Copy the module to Magento:

```
mkdir -p app/code/Ashokdubariya/Testimonial
# Copy module files to app/code/Ashokdubariya/Testimonial
```

2. Run Magento commands:

```
php bin/magento module:enable Ashokdubariya_Testimonial
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy -f
php bin/magento cache:flush
```

GraphQL Endpoint
----------------

[](#graphql-endpoint)

After installation, the GraphQL endpoint is available at:

```
https://your-magento-site.com/graphql

```

GraphQL Schema Example
----------------------

[](#graphql-schema-example)

File: `etc/schema.graphqls`

Queries
-------

[](#queries)

### 1. Get All Testimonials (with Filtering &amp; Pagination)

[](#1-get-all-testimonials-with-filtering--pagination)

#### Basic Query

[](#basic-query)

```
query {
  testimonials(currentPage: 1, pageSize: 10) {
    total_count
    items {
      testimonial_id
      customer_name
      customer_email
      message
      rating
      status
      created_at
      updated_at
    }
  }
}
```

#### With Filters - Filter by Status

[](#with-filters---filter-by-status)

```
query {
  testimonials(
    currentPage: 1
    pageSize: 10
    filter: {
      status: { eq: "1" }
    }
  ) {
    total_count
    items {
      testimonial_id
      customer_name
      message
      rating
      created_at
    }
  }
}
```

#### With Filters - Filter by Rating

[](#with-filters---filter-by-rating)

```
query {
  testimonials(
    filter: {
      rating: { eq: "5" }
    }
  ) {
    total_count
    items {
      testimonial_id
      customer_name
      message
      rating
    }
  }
}
```

#### With Filters - Search by Name (LIKE)

[](#with-filters---search-by-name-like)

```
query {
  testimonials(
    filter: {
      customer_name: { like: "John" }
    }
  ) {
    total_count
    items {
      testimonial_id
      customer_name
      message
    }
  }
}
```

#### With Filters - Multiple Ratings (IN)

[](#with-filters---multiple-ratings-in)

```
query {
  testimonials(
    filter: {
      rating: { in: ["4", "5"] }
    }
  ) {
    total_count
    items {
      testimonial_id
      customer_name
      rating
    }
  }
}
```

#### With Filters - Date Range

[](#with-filters---date-range)

```
query {
  testimonials(
    filter: {
      created_at: {
        from: "2026-01-01"
        to: "2026-01-31"
      }
    }
  ) {
    total_count
    items {
      testimonial_id
      customer_name
      created_at
    }
  }
}
```

#### With Filters - Combined Filters

[](#with-filters---combined-filters)

```
query {
  testimonials(
    currentPage: 1
    pageSize: 20
    filter: {
      status: { eq: "1" }
      rating: { in: ["4", "5"] }
      customer_name: { like: "John" }
    }
  ) {
    total_count
    items {
      testimonial_id
      customer_name
      message
      rating
      status
      created_at
    }
  }
}
```

### 2. Get Testimonial by ID

[](#2-get-testimonial-by-id)

```
query {
  testimonial(id: 5) {
    testimonial_id
    customer_name
    customer_email
    message
    rating
    status
    created_at
    updated_at
  }
}
```

#### Response

[](#response)

```
{
  "data": {
    "testimonial": {
      "testimonial_id": 5,
      "customer_name": "John Doe",
      "customer_email": "john@example.com",
      "message": "Excellent service!",
      "rating": 5,
      "status": 1,
      "created_at": "2026-01-06 15:00:00",
      "updated_at": "2026-01-06 16:30:00"
    }
  }
}
```

Mutations
---------

[](#mutations)

### 3. Add Testimonial

[](#3-add-testimonial)

```
mutation {
  addTestimonial(
    input: {
      customer_name: "John Doe"
      customer_email: "john@example.com"
      message: "Excellent service! Highly recommended."
      rating: 5
    }
  ) {
    testimonial_id
    status
    message
  }
}
```

#### Response

[](#response-1)

```
{
  "data": {
    "addTestimonial": {
      "testimonial_id": 6,
      "status": "success",
      "message": "Testimonial submitted successfully. It will be reviewed by our team."
    }
  }
}
```

### 4. Update Testimonial

[](#4-update-testimonial)

Update one or more fields of an existing testimonial.

#### Update All Fields

[](#update-all-fields)

```
mutation {
  updateTestimonial(
    id: 5
    input: {
      customer_name: "John Smith"
      customer_email: "john.smith@example.com"
      message: "Updated message - Still excellent!"
      rating: 5
      status: 1
    }
  ) {
    testimonial_id
    status
    message
    testimonial {
      testimonial_id
      customer_name
      customer_email
      message
      rating
      status
      updated_at
    }
  }
}
```

#### Update Specific Fields Only

[](#update-specific-fields-only)

```
mutation {
  updateTestimonial(
    id: 5
    input: {
      status: 1
    }
  ) {
    testimonial_id
    status
    message
    testimonial {
      testimonial_id
      status
      updated_at
    }
  }
}
```

#### Update Rating and Message

[](#update-rating-and-message)

```
mutation {
  updateTestimonial(
    id: 5
    input: {
      message: "Updated testimonial message"
      rating: 4
    }
  ) {
    testimonial_id
    status
    message
  }
}
```

#### Response

[](#response-2)

```
{
  "data": {
    "updateTestimonial": {
      "testimonial_id": 5,
      "status": "success",
      "message": "Testimonial updated successfully.",
      "testimonial": {
        "testimonial_id": 5,
        "customer_name": "John Smith",
        "customer_email": "john.smith@example.com",
        "message": "Updated message - Still excellent!",
        "rating": 5,
        "status": 1,
        "updated_at": "2026-01-06 16:50:00"
      }
    }
  }
}
```

### 5. Delete Testimonial

[](#5-delete-testimonial)

```
mutation {
  deleteTestimonial(id: 5) {
    status
    message
  }
}
```

#### Response

[](#response-3)

```
{
  "data": {
    "deleteTestimonial": {
      "status": "success",
      "message": "Testimonial deleted successfully."
    }
  }
}
```

#### Error Response (Not Found)

[](#error-response-not-found)

```
{
  "errors": [
    {
      "message": "Testimonial with ID 999 not found.",
      "extensions": {
        "category": "graphql-no-such-entity"
      }
    }
  ]
}
```

Filter Options
--------------

[](#filter-options)

### Available Filter Fields

[](#available-filter-fields)

- `customer_name` - Filter by customer name
- `customer_email` - Filter by email
- `rating` - Filter by rating (1-5)
- `status` - Filter by status (0=Disabled, 1=Enabled)
- `created_at` - Filter by creation date

### Filter Types

[](#filter-types)

Filter TypeDescriptionExample`eq`Equal to`{ eq: "1" }``in`In array`{ in: ["4", "5"] }``like`Pattern match`{ like: "John" }``from`Greater than or equal`{ from: "2026-01-01" }``to`Less than or equal`{ to: "2026-01-31" }`cURL Examples
-------------

[](#curl-examples)

### Get Filtered Testimonials

[](#get-filtered-testimonials)

```
curl -X POST https://your-magento-site.com/graphql \
  -H "Content-Type: application/json" \
  -d '{
    "query": "query { testimonials(filter: { status: { eq: \"1\" }, rating: { in: [\"4\", \"5\"] } }) { total_count items { testimonial_id customer_name rating } } }"
  }'
```

### Update Testimonial

[](#update-testimonial)

```
curl -X POST https://your-magento-site.com/graphql \
  -H "Content-Type: application/json" \
  -d '{
    "query": "mutation { updateTestimonial(id: 5, input: { status: 1 }) { testimonial_id status message } }"
  }'
```

### Delete Testimonial

[](#delete-testimonial)

```
curl -X POST https://your-magento-site.com/graphql \
  -H "Content-Type: application/json" \
  -d '{
    "query": "mutation { deleteTestimonial(id: 5) { status message } }"
  }'
```

Common Use Cases
----------------

[](#common-use-cases)

### 1. Get Only 5-Star Testimonials

[](#1-get-only-5-star-testimonials)

```
query {
  testimonials(filter: { rating: { eq: "5" }, status: { eq: "1" } }) {
    items {
      customer_name
      message
      created_at
    }
  }
}
```

### 2. Get Recent Testimonials (Last 30 Days)

[](#2-get-recent-testimonials-last-30-days)

```
query {
  testimonials(
    filter: {
      created_at: { from: "2025-12-07" }
      status: { eq: "1" }
    }
  ) {
    items {
      customer_name
      message
      rating
      created_at
    }
  }
}
```

### 3. Search Testimonials by Customer Email

[](#3-search-testimonials-by-customer-email)

```
query {
  testimonials(filter: { customer_email: { like: "@example.com" } }) {
    items {
      testimonial_id
      customer_name
      customer_email
      message
    }
  }
}
```

### 4. Approve Testimonial (Change Status)

[](#4-approve-testimonial-change-status)

```
mutation {
  updateTestimonial(id: 10, input: { status: 1 }) {
    status
    message
    testimonial {
      testimonial_id
      status
    }
  }
}
```

### 5. Bulk Approve by Getting Disabled and Updating

[](#5-bulk-approve-by-getting-disabled-and-updating)

```
# Step 1: Get disabled testimonials
query {
  testimonials(filter: { status: { eq: "0" } }) {
    items {
      testimonial_id
      customer_name
      message
    }
  }
}

# Step 2: Update each one
mutation {
  updateTestimonial(id: 10, input: { status: 1 }) {
    status
    message
  }
}
```

Validation Rules
----------------

[](#validation-rules)

### Add/Update Testimonial

[](#addupdate-testimonial)

- **customer\_name**: Required (for add), max 255 characters
- **customer\_email**: Required (for add), valid email format, max 255 characters
- **message**: Required (for add), no length limit
- **rating**: Required (for add), integer 1-5
- **status**: Optional, 0 or 1

### Filter Values

[](#filter-values)

- All filter values should be strings (even numbers)
- Date format: `YYYY-MM-DD` or `YYYY-MM-DD HH:MM:SS`
- Use `like` for partial matches (automatically adds % wildcards)

Status Values
-------------

[](#status-values)

- `0` = Disabled (default for customer submissions)
- `1` = Enabled (visible in public queries)

Complete API Summary
--------------------

[](#complete-api-summary)

OperationTypeDescription`testimonials`QueryGet paginated list with filtering`testimonial`QueryGet single testimonial by ID`addTestimonial`MutationCreate new testimonial`updateTestimonial`MutationUpdate existing testimonial`deleteTestimonial`MutationDelete testimonialTesting with GraphQL Playground
-------------------------------

[](#testing-with-graphql-playground)

1. Navigate to: `https://your-magento-site.com/graphql`
2. Use the schema explorer to see all available fields
3. Test queries and mutations interactively
4. View auto-complete suggestions

Additional Resources
--------------------

[](#additional-resources)

- **Admin Panel**: `/admin/testimonial/testimonial/index`
- **Frontend Listing**: `/testimonial`
- **Submit Form**: `/testimonial/submit`
- **Module Location**: `/app/code/Ashokdubariya/Testimonial`

Support
-------

[](#support)

- **Source**: [GitHub Repository](https://github.com/ashokdubariya/magento2-testimonial-graphql)
- **Issues**: [GitHub Issues](https://github.com/ashokdubariya/magento2-testimonial-graphql/issues)

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance70

Regular maintenance activity

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

170d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12961793?v=4)[Ashokkumar Dubariya](/maintainers/ashokdubariya)[@ashokdubariya](https://github.com/ashokdubariya)

---

Top Contributors

[![ashokdubariya](https://avatars.githubusercontent.com/u/12961793?v=4)](https://github.com/ashokdubariya "ashokdubariya (4 commits)")

---

Tags

graphqlhyva-compatiblemagento2ratingstestimonialsgraphqlmagento2magento2 moduleratingstestimonialstestimonialcustomer-reviewshyva-theme

### Embed Badge

![Health badge](/badges/ashokdubariya-module-testimonial/health.svg)

```
[![Health](https://phpackages.com/badges/ashokdubariya-module-testimonial/health.svg)](https://phpackages.com/packages/ashokdubariya-module-testimonial)
```

###  Alternatives

[mollie/magento2

Mollie Payment Module for Magento 2

1131.9M16](/packages/mollie-magento2)[smile/elasticsuite

Magento 2 merchandising and search engine built on ElasticSearch

8064.7M49](/packages/smile-elasticsuite)[opengento/module-category-import-export

This module add the capability to import and export the categories from the back-office.

1310.9k2](/packages/opengento-module-category-import-export)[run-as-root/magento2-prometheus-exporter

Magento2 Prometheus Exporter

68357.9k](/packages/run-as-root-magento2-prometheus-exporter)[mage-os/module-admin-activity-log

The Admin Activity extension makes it easy to track all admin activity with comprehensive audit logging.

296.3k](/packages/mage-os-module-admin-activity-log)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
