Magento 2 Marketplace Show Seller on CategoryMagento 2 Marketplace Show Seller on Category
Live Demo
Buy Now
Support
Live Demo
Buy Now
Support
  • Getting Started

    • Introduction
    • Requirements
    • Installation
    • Activation
  • Features

    • Category Display Modes
    • Seller Navigation Filter
    • GraphQL API
    • Hyvä Theme Compatibility
  • Help

    • Troubleshooting
    • FAQ

GraphQL API

The Marketplace Show Seller on Category extension fully supports headless and PWA architectures by exposing GraphQL queries to fetch category seller listings and filter options.


Products Query Extension

The module extends the standard products GraphQL query with two custom fields: sellerCollection and sellerFilterOptions.

Endpoint

  • URL: {base_url}/graphql
  • Method: POST

Query Schema

{
  products(
    search: ""
    filter: { category_id: { eq: 4 } }
    pageSize: 5
    sort: {}
  ) {
    sellerCollection {
        seller_id
        name
        categoryId
        logoPic
        rating
        productCount
        orderCount
    }
    sellerFilterOptions {
        key
        value {
            count
            label
            url
        }
    }
  }
}

Fields Description

FieldTypeDescription
sellerCollectionListReturns the details of the sellers operating under the specified category.
seller_idIntUnique seller ID.
nameStringSeller's name/shop name.
categoryIdIntCurrent category ID.
logoPicStringURL to the seller's profile logo.
ratingFloatAverage rating score of the seller.
productCountIntNumber of active products listed by the seller under this category.
orderCountIntCount of completed orders.
sellerFilterOptionsListReturn list of available filter options (e.g., rating ranges, locations) with matching item counts and URLs.

Response Example

{
    "data": {
        "products": {
            "sellerCollection": [
                {
                    "seller_id": 2,
                    "name": "John Doe",
                    "categoryId": 4,
                    "logoPic": "http://yourstore.com/media/avatar/noimage.png",
                    "rating": 0,
                    "productCount": 4,
                    "orderCount": 1
                }
            ],
            "sellerFilterOptions": [
                {
                    "key": "rating",
                    "value": [
                        {
                            "count": 1,
                            "label": "0 to 1 star",
                            "url": "http://yourstore.com/graphql?rating=1"
                        },
                        {
                            "count": 0,
                            "label": "1 to 2 star",
                            "url": "http://yourstore.com/graphql?rating=2"
                        }
                    ]
                },
                {
                    "key": "country",
                    "value": [
                        {
                            "count": 1,
                            "label": "United States",
                            "url": "http://yourstore.com/graphql?country=US"
                        }
                    ]
                }
            ]
        }
    }
}

CategoryPageData Query Extension

This module also extends the CategoryPageData GraphQL type (often used in headless/PWA category pages) to fetch seller collection and filters optimized for the active category context.

Fields Added

  • mpsellerCollection: Returns the list of sellers associated with the active category.
  • mpsellerFilterOptions: Returns the available filter options (ratings, countries) for the active category.

Query Schema Example

{
  categoryPageData(id: 4) {
    mpsellerCollection {
      seller_id
      name
      categoryId
      logoPic
      rating
      productCount
      orderCount
    }
    mpsellerFilterOptions {
      key
      value {
        count
        label
        url
      }
    }
  }
}

Fields Description

FieldTypeDescription
mpsellerCollectionListReturns the details of the sellers operating under this category.
mpsellerFilterOptionsListReturns list of available filter options (e.g., rating, country) for the category page.

Response Example

{
  "data": {
    "categoryPageData": {
      "mpsellerCollection": [
        {
          "seller_id": 2,
          "name": "John Doe",
          "categoryId": 4,
          "logoPic": "http://yourstore.com/media/avatar/noimage.png",
          "rating": 0,
          "productCount": 4,
          "orderCount": 1
        }
      ],
      "mpsellerFilterOptions": [
        {
          "key": "rating",
          "value": [
            {
              "count": 1,
              "label": "0 to 1 star",
              "url": "http://yourstore.com/graphql?rating=1"
            },
            {
              "count": 0,
              "label": "1 to 2 star",
              "url": "http://yourstore.com/graphql?rating=2"
            }
          ]
        },
        {
          "key": "country",
          "value": [
            {
              "count": 1,
              "label": "United States",
              "url": "http://yourstore.com/graphql?country=US"
            }
          ]
        }
      ]
    }
  }
}
Prev
Seller Navigation Filter
Next
Hyvä Theme Compatibility