pwa-studio: Cannot query field "fashion_color"

This issue is a:

  • Documentation issue

Environment

Question Answer
Magento version 2.3.0
Operating System + version Ubuntu 16.04
node.js version (node -v) 10.14.1
npm version (npm -v) 6.4.1

Description

Using environment variables from .env Errors found!

/var/www/html/magento223/pwa-studio/packages/venia-concept/src/queries/getProductDetail.graphql 37:25 error Cannot query field “fashion_color” on type “SimpleProduct” graphql/template-strings

/var/www/html/magento223/pwa-studio/packages/venia-concept/src/RootComponents/Product/Product.js 48:29 error Cannot query field “fashion_color” on type “SimpleProduct” graphql/template-strings

✖ 2 problems (2 errors, 0 warnings)

These errors may indicate:

  • an out-of-date Magento 2.3 codebase running at “http://magento223.local/
  • an out-of-date project codebase whose queries need updating

Use GraphiQL or another schema exploration tool on the Magento store to learn more.

Expected result:

run pwa

Possible solutions:

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

@aliaathil this is the GraphQL query validation which runs with npm run build and npm watch:venia .

This happens because you’re running against a Magento instance that has no Venia sample data and because the Venia GraphQL queries for product options fashion_color and fashion_size are hardcoded.

Comment out fashion_color and fashion_size in both packages/venia-concept/src/queries/getProductDetail.graphql and packages/venia-concept/src/RootComponents/Product/Product.js and you will be able run npm run build and npm run watch:venia with a custom Magento 2.3 instance.

hey @cnu115 if you’re running against a Magento instance with Venia sample data then commenting out the variants in the GraphQL query will indeed error when trying to add products to cart.

So are you running Magento PWA Studio against a local Magento instance with Venia data?

If that’s the case does your local PWA Studio also have these issues with the default configured MAGENTO_BACKEND_URL (see env.dist) ?

I actually found that files in my venia/dist/js folder were still pointing to an old setup. Fixed it for myself anyway.

yw @aliaathil glad it helped and thanks for closing the issue .