Type
magento2-module
Magento 2.3 module to add some hacks to GraphQL API
magento2-module
OSL-3.0
None
None
None
None
None
The new Magento 2.3 GraphQL system could be used with GraphQL clients
(like Apollo or even Axios) to fetch data from Magento. Most of these
clients use an HTTP request OPTIONS to see if CORS restrictions apply.
This module adds an OPTIONS check to the GraphQL API. Also, this module
adds Cross Origin headers (currently hard-coded to
http://localhost:3000
).
composer require yireo-training/magento2-corshack
./bin/magento module:enable Yireo_CorsHack
Navigate to Advanced > Yireo CorsHack and add your URLs to the Origin Domain option.
By default, the following URLs work right away:
- http://localhost/
- http://localhost:3000/
If you want all domains to match, add a wildcard (*
) to the Origin Domain option.