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

Error when querying the slug of deleted products #1125

Closed
BenVuti opened this issue Sep 29, 2021 · 0 comments
Closed

Error when querying the slug of deleted products #1125

BenVuti opened this issue Sep 29, 2021 · 0 comments
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@BenVuti
Copy link

BenVuti commented Sep 29, 2021

I'm trying to find the slug of all the products that a customer bought with this query:

query {
  activeCustomer {
    orders(
      options: {
        filter: {
          state: { in: ["PaymentAuthorized", "PaymentSettled", "Delivered"] }
          totalQuantity: { gt: 0 }
        }
      }
    ) {
      items {
        lines {
          productVariant {
            product {
              slug
            }
          }
        }
      }
    }
  }
}

During my testing I deleted a product previously bought by the customer.
This result in the following error when running the query :

{
  "errors": [
    {
      "message": "No Product with the id '16' could be found",
      "locations": [
        {
          "line": 9,
          "column": 13
        }
      ],
      "path": [
        "activeCustomer",
        "orders",
        "items",
        16,
        "lines",
        0,
        "productVariant",
        "product"
      ],
      "extensions": {
        "code": "ENTITY_NOT_FOUND"
      }
    }
  ],
  "data": {
    "activeCustomer": null
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants