“Cannot query field “newsletter_enabled” someone face this kind of issue when setup PWA with magento.
Error :-
Error: Cannot query field “newsletter_enabled” on type “StoreConfig”. (… 1 errors total)
at /var/www/vhosts/mysite.com/htdocs/pwa-studio/node_modules/@magento/pwa-buildpack/lib/Utilities/graphQL.js:54:21
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async module.exports (/var/www/vhosts/mysite.com/htdocs/pwa-studio/webpack.config.js:62:29)
Solution:-
Run the below command in Magento root which is defined in the .env file of the PWA setup,
In my case, I used “MAGENTO_BACKEND_URL=https://example.com/” URL in the .env file, so I will run the below command from the “https://example.com/” Magento root directory.
Commands:-
composer require magento/pwa
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy -f
Then :
php bin/magento module:enable –clear-static-content Magento_ContactGraphQlPwa
php bin/magento module:enable –clear-static-content Magento_NewsletterGraphQlPwa
php bin/magento module:enable –clear-static-content Magento_QuoteGraphQlPwa
Reference: https://github.com/magento/pwa-studio/issues/3565
Similar: Step by step create PWA website