Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Password protected products break "products" response #879

Open
JaidonLalor opened this issue Jul 29, 2024 · 1 comment
Open

Password protected products break "products" response #879

JaidonLalor opened this issue Jul 29, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@JaidonLalor
Copy link

JaidonLalor commented Jul 29, 2024

Describe the bug
I had two password protected products that broke my "products" query.

I got this message:
{ "errors": [ { "debugMessage": "Cannot return null for non-nullable field \"SimpleProduct.id\".", "message": "Internal server error", "extensions": { "category": "internal" }, "locations": [ { "line": 4, "column": 7 } ], "path": [ "products", "nodes", 10, "id" ] } ],

Manual Fix
I made the 2 password protected products private, or moved them to drafts, and saved. Then queries resolve successfully.

To Reproduce
I attempted to reproduce this twice. The first time I was unsuccessful and password protected products worked.
I then had to re-clone the wordpress weeks later and came across the same issue. This time, adding a password to a product breaks it.

Expected behavior
See all products except password protected products.
Or see an error message notifying me to make my password protected products private, or a draft.

Screenshots
Video demonstration: https://youtu.be/AfcBLyExVt4
Screenshot 2024-07-29 at 3 25 54 PM

Plugin Versions

  • WooGraphQL Version: 0.19.0
  • WPGraphQL Version: 1.28.0
  • WordPress Version: 6.5.5
  • WooCommerce Version: 9.1.4
@JaidonLalor JaidonLalor changed the title Private products break "products" response on recently upgraded wordpress + woocommerce Private products break "products" response Aug 21, 2024
@JaidonLalor JaidonLalor changed the title Private products break "products" response Password protected products break "products" response Aug 21, 2024
@kidunot89 kidunot89 added the bug Something isn't working label Aug 29, 2024
@kidunot89
Copy link
Member

kidunot89 commented Aug 29, 2024

@JaidonLalor Yea this has been an issue for awhile now. An easy workaround is the active the Unsupported Product type option in the GraphQL Settings which should result in those private product being nulled out.

@kidunot89 kidunot89 added this to the v0.21.1 milestone Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants