mageworx/module-faq-graphql

GraphQL API for MageWorx FAQ module.

Maintainers

Package info

github.com/mageworx/MageWorx_FaqGraphQl

Type:magento2-module

pkg:composer/mageworx/module-faq-graphql

Transparency log

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 1

1.0.0 2026-04-08 09:24 UTC

This package is auto-updated.

Last update: 2026-08-18 12:05:22 UTC


README

GraphQL addon for the MageWorx_Faq module. Exposes FAQ data (blocks and Q&A items) via Magento GraphQL API for headless and Hyva storefronts.

Requirements

  • Magento 2.4.x with Magento_GraphQl module enabled
  • MageWorx_Faq module installed and enabled

Installation

The module is installed as part of the MageWorx FAQ package. After placing files run:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush

Queries

FAQ by Product

{
  faqByProduct(product_id: 42) {
    blocks {
      block_id
      title
      description
      type
      sort_order
      items {
        item_id
        question_id
        answer_id
        sort_order
        question
        answer
      }
    }
  }
}

FAQ by Category

{
  faqByCategory(category_id: 10) {
    blocks {
      title
      items {
        question_id
        question
        answer
      }
    }
  }
}

FAQ by CMS Page

{
  faqByCmsPage(page_id: 5) {
    blocks {
      title
      items {
        question
        answer
      }
    }
  }
}

FAQ by Block (direct)

{
  faqByBlock(block_id: 3) {
    blocks {
      title
      items {
        question
        answer
      }
    }
  }
}

Store Configuration

Frontend display settings are available via storeConfig:

{
  storeConfig {
    mageworx_faq_enabled
    mageworx_faq_accordion_mode
    mageworx_faq_answers_default_state
    mageworx_faq_open_first_question
    mageworx_faq_show_block_titles
    mageworx_faq_answers_spoiler_limit
  }
}

Response Types

Type Fields
FaqPage blocks: [FaqBlock!]!
FaqBlock block_id, title, description, type, sort_order, items
FaqItem item_id, question_id, answer_id, sort_order, question, answer

Store Scope

All queries automatically resolve values for the store determined by the request's Store header, with fallback to default (store 0) values.

Caching

Responses are cached at the GraphQL layer using the @cache directive with FaqIdentity as the cache identity provider. Cache is invalidated when any FAQ block, question, or answer is modified in the admin panel — including per-store-view content changes.

Anchor Links (headless)

FaqItem.question_id is a stable database ID that does not change on reordering. Headless storefronts can use it to build deep links to specific FAQ questions:

https://example.com/product.html#faq-question-{question_id}

This matches the anchor link format used by the standard Luma/Hyva frontend rendering in MageWorx_Faq.