question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug]: Cannot query field \"custom_attributes\" on type \"ProductInterface\"

See original GitHub issue

Describe the bug

I installed the last pwa studio version 12.2.0 in my local environment and connect whit Magento Commerce 2.4.3-p1 and sample data. When I navigate to some product I have an error with the GraphQL query of getProductDetailForProductPage. The error is Cannot query field "custom_attributes" on type "ProductInterface". And checking Magento Catalog_Product module, custom_attributes it’s not declared in Productinterface GraphQL.

To reproduce

Steps to reproduce the behavior:

  1. Install pwa studio version 12.2.0
  2. Install a Magento Commerce 2.4.3-p1
  3. Navigate to some producto page and enable networks tab on developer inspector
  4. Check request graphql?query=query+getProductDetailForProductPage
  5. See error

Expected behavior

I need to know how to proceed.

Screenshots

pwa-studio-12 2 0

Possible solutions

Remove custom_attributes from default node_modules/@magento/peregrine/lib/talons/RootComponents/Product/productDetailFragment.gql.js or add this field in Magento by default

Debug Report

Paste the output of yarn build:report, and any other context about the problem, here.

Please complete the following device information:

  • Device [Ubuntu 20.04]:
  • Browser [Chrome]:
  • Browser Version [98.0.4758.80]:
  • Magento Version [Magento Commerce 2.4.3-p1]:

Please let us know what packages this bug is in regards to:

  • venia-concept
  • venia-ui
  • pwa-buildpack
  • peregrine
  • pwa-devdocs
  • upward-js
  • upward-spec
  • create-pwa

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

1reaction
Watch3rukcommented, Feb 6, 2022

you need to update your composer.json in magento changing / adding : (for CE ) “magento/module-upward-connector”: “2.0.0”, “magento/pwa”: “0.1.0” then obviously php/bin upgrade , d:c and deploy content . and in your pwa folder git checkout main .

0reactions
joseamiettacommented, Feb 7, 2022

The problem was related to the cache of composer… I had to remove extemsions loads from path ext, and them run it this

composer require magento/pwa:0.1.0 --no-cache -W

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why I got error: Cannot query field xx on type "Query"?
The fault with my query was that I didn't download the new schema. You can download the schema by using: apollo schema:download ...
Read more >
Solved: How to add custom product attribute in graphQL?
Problem Solved ? Click on 'Kudos' & Accept as ... to retrieve custom attributes. We can just pass the custom attribute code to...
Read more >
Magento 2 GraphQL: Filter Products by custom attribute
I want to query products by a custom attribute that I created in the admin. Couldn't find in the documentation how to. It...
Read more >
Filtering with custom attributes | Commerce Web APIs
Filtering with custom attributes. As of 2.3.4, the filter attribute of the products query accepts the ProductAttributeFilterInput object.
Read more >
Problem filtering by custom attributes
When I am creating the Attribute filter inside the plugin, but I guess I need to type the custom attribute slug that was...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found