yireo / magento2-additional-endpoints-graph-ql
Package info
github.com/yireo/Yireo_AdditionalEndpointsGraphQl
Type:magento2-module
pkg:composer/yireo/magento2-additional-endpoints-graph-ql
Requires
- php: >=7.0.0
- magento/framework: ^102.0|^103.0
- magento/module-catalog: ^101.0|^102.0|^103.0|^104.0
- magento/module-cms: ^101.0|^102.0|^103.0|^104.0
- magento/module-graph-ql: ^100.0
Requires (Dev)
- composer/composer: *@dev
- phpunit/phpunit: *
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-11-24 14:27:30 UTC
README
This module offers some additional endpoints for loading information through GraphQL.
Installation
Use the following commands to install this module into Magento 2:
composer require yireo/magento2-additional-endpoints-graph-ql:@dev
bin/magento module:enable Yireo_AdditionalEndpointsGraphQl
bin/magento setup:upgrade
productById(Int! id) - Get a product by its ID
Only enabled products that are visible in the catalog or search, and that are assigned to the current website, are returned.
Example:
{
productById(id:42){
sku
name
}
}
productBySku(String! sku) - Get a product by its SKU
The same restrictions as for productById apply.
Example:
{
productBySku(sku:"VA22-SI-NA"){
sku
name
}
}
categoryById(Int! id) - Get a category by its ID
Only active categories within the root category of the current store are returned.
Example:
{
categoryById(id:3){
id
name
}
}
cmsBlock(String! identifier) - Get a CMS block by its identifier
Only active blocks of the current store view (or all store views) are returned. Directives in the content are processed.
Example:
{
cmsBlock(identifier:"example"){
title
content
}
}
cmsPages - Get all CMS pages
Returns the first 20 active pages of the current store view (or all store views). Directives in the content are processed.
Example:
{
cmsPages {
items {
title
}
}
}
cmsWidget(Int! id) - Get a CMS widget by its ID
Only widget instances of a known widget type, assigned to the current store view (or all store views) and to the theme of the current store view, are returned. Only scalar parameters from an allowlist are returned (the $allowedParameters constructor argument of Yireo\AdditionalEndpointsGraphQl\Model\Resolver\CmsWidget, which you can change via di.xml).
Example:
{
cmsWidget(id: 2) {
id
title
html
parameters {
name
value
}
}
}
validateCustomerToken - Validate a customer token
Send the customer token as Authorization: Bearer <token> header. The query returns true when the token belongs to a customer and is valid (not expired, not revoked). It returns false without a token. An invalid or expired token is rejected by Magento with an authorization error.
Example:
query validateToken { validateCustomerToken }
Up to version 0.0.3, this query had a token argument. This argument was removed for security reasons.