In this guide, you will set up a GraphCommerce app locally, allowing you to start building.
nvm install 20
or nvm use 20
corepack enable
git clone -b main --depth 1 https://github.com/graphcommerce-org/graphcommerce.git
# Clone repository
mkdir my-project
# Create project folder
There are a few starting points to choose from with or without Hygraph:
Option 1: Only Magento Open Source:
cp -R graphcommerce/examples/magento-magento-open-source/. my-project && cd my-project
Option 2: Magento Open Source + Hygraph:
cp -R graphcommerce/examples/magento-graphcms/. my-project && cd my-project
Option 3: Adobe Commerce:
Please contact us for more information to get access to the Adobe Commerce starting point.
Duplicate and rename the configuration example file to:
graphcommerce.config.js
and configure the following:
magentoStoreCode
The first storeview in your object is loaded by default, with no added suffix to the URL. As the user switches to, e.g., the Canadian storeview, the suffix /en-ca is added to the URL. The locale, e.g., en-ca, is used to load the storeview translation A user is auto-redirected to the relevant storeview when their browser language matches the locale (Admin > Store > Configuration > General > General > Locale
) of that storeview.
touch yarn.lock && yarn
# Install dependencies (may take a while)
yarn codegen
# Converts all .graphql files to typescript files
yarn dev
# Run the app
🎉 Explore your GraphCommerce app running at http://localhost:3000
(Explore the GraphQL Playground running at http://localhost:3000/api/graphql)
No success? Consult the troubleshooting guide