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

New product error - Invalid input syntax for type uuid: "create" #3048

Open
carxavier opened this issue Sep 6, 2024 · 6 comments
Open

New product error - Invalid input syntax for type uuid: "create" #3048

carxavier opened this issue Sep 6, 2024 · 6 comments
Labels
status: reproduction needed 🔁 Reproduction of described behaviour needed by core team type: bug 🐛 Something isn't working

Comments

@carxavier
Copy link

carxavier commented Sep 6, 2024

Describe the bug
We have UuidIdStrategy as entityIdStrategy and the the error message invalid input syntax for type uuid: "create" when trying to create a new product.

This is the query performed when entering the new product page:

 {
  "operationName": "GetProductVariants",
  "variables": {
    "id": "create"
  },
  "query": "query GetProductVariants($id: ID!) {
    productVariants(productId: $id) {
      items {
        id
        sku
        name
        priceWithTax
        customFields {
          code
          __typename
        }
        __typename
      }
      __typename
    }
  }"
}

To Reproduce
Steps to reproduce the behavior:

  1. Add entityIdStrategy as "new UuidIdStrategy()" in vendure-config
  2. Go to "Products" in the backoffice
  3. Click "New product"
  4. The error appears top right

Expected behavior
It's not preventing a new product from being created, but no error should appear.

Environment (please complete the following information):

  • @vendure/core version: 2.2.6
  • Nodejs version: v20.17.0
  • Database (mysql/postgres etc): postgres
@carxavier carxavier added the type: bug 🐛 Something isn't working label Sep 6, 2024
@carxavier
Copy link
Author

@michaelbromley can you validate if this can be changed on my side (configuration or code) or if it is a change in the source coed?

@michaelbromley
Copy link
Member

I'm looking into this now.

@michaelbromley
Copy link
Member

Hi, I tried to reproduce this on the current master branch and cannot:

Recording.2024-09-25.212609.mp4

Can you check whether this is still an issue in the latest version?

@michaelbromley michaelbromley added the status: reproduction needed 🔁 Reproduction of described behaviour needed by core team label Sep 25, 2024
@carxavier
Copy link
Author

Yes, updated to the latest version just for the test and still get the error:

Screen.Recording.2024-09-26.at.10.38.56.mov

@michaelbromley
Copy link
Member

OK thank you. Can you take a look into the network tab when this occurs and check what mutation is being sent? Include the mutation body & what variables are being sent please.

@KilianSSL
Copy link

We believe we're having an issue going in the same direction, when we have a custom, string-based entityIdStrategy.
It fails fetching the product-variants when accessing a product-detail in the admin.

[email protected]

{
   "errors": [
       {
           "message": "invalid input syntax for type integer: \"YQjplm\"",
           "locations": [
               {
                   "line": 2,
                   "column": 3
               }
           ],
           "path": [
               "productVariants"
           ]
       }
   ],
   "data": null
}

here's the repro:
https://github.com/KilianSSL/vendure-custom-id-strategy-repro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: reproduction needed 🔁 Reproduction of described behaviour needed by core team type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants