yireo/magento2-additional-endpoints-graph-ql

Fund package maintenance!
yireo
www.paypal.me/yireo

Installs: 2 831

Dependents: 0

Suggesters: 0

Security: 0

Stars: 11

Watchers: 5

Forks: 5

Open Issues: 1

Type:magento2-module

0.0.3 2020-07-29 09:30 UTC

This package is auto-updated.

Last update: 2024-10-09 21:49:31 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 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

Example:

{
  productById(id:42){
    sku
    name
  }
}

productBySku(String! sku) - Get a product by its SKU

Example:

{
  productBySku(sku:"VA22-SI-NA"){
    sku
    name
  }
}

categoryById(Int id) - Get a category by its ID

Example:

{
  categoryById(id:1){
    id
    name
  }
}

cmsBlock(String! identifier) - Get a CMS block by its identifier

Example:

{
  cmsBlock(identifier:"example"){
    title
    content
  }
}

cmsPages - Get all CMS pages

Example:

{
  cmsPages {
    items {
      title
    }
  }
}

cmsWidget(Int! id) - Get a CMS widget by its ID

Example:

{
  cmsWidget(id: "2") {
    id
    title
    html
    parameters {
      name
      value
    }
  }
}

validateCustomerToken - Validate a customer token

Example:

query validateToken {
  validateCustomerToken(token:"abc")
}