hyva-themes / magento2-graphql-tokens
Adds Customer and Cart tokens to CustomerData sections
Installs: 1 165 186
Dependents: 1
Suggesters: 1
Security: 0
Stars: 23
Watchers: 16
Forks: 7
Open Issues: 0
Type:magento2-module
Requires
- magento/framework: *
- magento/module-catalog: >=103.0.0
- magento/module-checkout: >=100.3.0
- magento/module-customer: >=102.0.0
This package is auto-updated.
Last update: 2024-10-30 01:59:36 UTC
README
hyva-themes/magento2-graphql-tokens
This module adds GraphQL tokens to the CustomerData sections to enable GraphQL calls from a Magento template.
Compatible with Magento 2.3.4 and higher.
What does it do?
It adds:
signin_token
to thecustomer
sectioncartId
to thecart
sectionstoreViewCode
to thecart
section
The CartId is the masked cartId
that is needed for guest carts. The storeViewCode
is needed to set the store-code on GraphqQl requests.
When logged in, the customer signin_token
can be used to get the real cart id.
Installation
- Install via composer
composer config repositories.hyva-themes/magento2-graphql-tokens git git@github.com:hyva-themes/magento2-graphql-tokens.git composer require hyva-themes/magento2-graphql-tokens
- Enable module
bin/magento setup:upgrade
Configuration
No configuration needed.
How does it work?
There are after-plugins
that add the tokens to the individual sections.
If a token already exists, it uses the existing one. Otherwise, a fresh token is generated on the fly.
Credits
License
The MIT License (MIT). Please see License File for more information.