Mageplaza Gift Card GraphQL Extension
Mageplaza Gift Card Extension supports getting and pushing data on the website with GraphQl.
Run the following command in Magento 2 root folder:
composer require mageplaza/module-gift-card-graphql php bin/magento setup:upgrade php bin/magento setup:static-content:deploy
To start working with Gift Card GraphQl in Magento, you need to:
- Use Magento 2.3.x. Return your site to developer mode
- Install chrome extension (currently does not support other browsers)
- Set GraphQL endpoint as
http://<magento2-3-server>/graphqlin url box, click Set endpoint. (e.g. http://develop.mageplaza.com/graphql/ce232/graphql)
The module currently supports the following 6 types of queries and 10 types of mutations:
- Query mpGiftCode: Support lookup Gift Code information by Gift Code ID.
- Query mpGiftCodeList: Support to look up Gift Code information according to certain conditions fields.
- Query mpGiftPool: Support searching for Gift Pool information by Gift Pool ID.
- Query mpGiftPoolList: Support searching for Gift Pool information according to certain conditional fields.
- Query mpGiftTemplate: Support for looking up Template information by Gift Template ID.
- Query mpGiftTemplateList: Support searching for Gift Pool information according to certain conditional fields.
- Mutation mpGiftCodeSave: Create/edit Gift Code. To edit an existing Gift Code, just input the value for the
giftcard_idfield corresponding to the gift code you want to edit.
- Mutation mpGiftCodeDelete: Delete the Gift Code according to the corresponding Gift Code ID.
- Mutation mpGiftPoolSave: Create new/edit Gift Pool. To edit an existing Gift Pool, just enter the value for the
pool_idfield corresponding to the gift pool you want to edit.
- Mutation mpGiftPoolDelete: Delete Gift Pool by Gift Pool ID.
- Mutation mpGiftPoolGenerate: Generate Gift Code for Gift Pool with corresponding ID.
- Mutation mpGiftTemplateSave: Create/edit Gift Template. To edit an existing Gift Template, just input the value for the
template_idfield corresponding to the template you want to edit.
- Mutation mpGiftTemplateDelete: Delete Gift Template according to Gift Template ID.
- Mutation mpGiftCardRedeem: Redeem Gift Code for customer with corresponding customerId.
- Mutation mpGiftCardSetCode: Apply Gift Code to cart according to the corresponding cartId.
- Mutation mpGiftCardRemoveCode: Cancel Gift Code is being applied to the cart according to the corresponding cartId.
- Mutation mpGiftCardSetCredit: Apply Gift Credit to cart according to cartId and corresponding amount.