Hyvä Themes - GraphQL Tokens module
hyva-themes/magento2-graphql-tokens
Adds GraphQL tokens (signin, cartId, storeViewCode) to customer and cart sections. Enables GraphQL calls from Magento templates, supporting guest carts and store code settings.
Build Tests
Code Quality
Tested on Magento 2.4.8-p3
Recent Test History
Each release is tested against the latest Magento version at that time.
Top Contributors
View LeaderboardShare This Module's Status
README
Loaded from GitHubHyvä Themes - GraphQL Tokens module
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_tokento thecustomersection -
cartIdto thecartsection -
storeViewCodeto thecartsection
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
This package is licensed under the Open Software License (OSL 3.0).
- Copyright: Copyright © 2020-present Hyvä Themes. All rights reserved.
-
License Text (OSL 3.0): The full text of the OSL 3.0 license can be found in the
LICENSE.txtfile within this package, and is also available online at http://opensource.org/licenses/osl-3.0.php.
This content is fetched directly from the module's GitHub repository. We are not the authors of this content and take no responsibility for its accuracy, completeness, or any consequences arising from its use.
