Skip to content

Missing key \"model\" in Wishlist value data #36909

Open
@ioweb-gr

Description

@ioweb-gr

Preconditions and environment

  • Magento 2.3.2 but the issue seems to be present on 2.4.5-p1 as well
  • Magento 2 in developer mode so that errors appear
  • Xdebug to make sure errors display
  • Do not login in Frontend

Steps to reproduce

  1. Create a customer
mutation {

  createCustomer(

    input: {

      firstname: "John"

      lastname: "Doe"

      email: "test1@example.com"

      password: "Test1234"

      is_subscribed: true

    }

  ) {

    customer {

      firstname

      lastname

      email

      is_subscribed

    }

  }

}
  1. Get a graphQL token
mutation {
  generateCustomerToken(email: "test1@example.com", password: "Test1234") {
    token
  }
}
  1. Query wishlist
query {
  wishlist {
    items {
      added_at
      description
      id

      product {
        name
        image {
          url
        }
        sku
      }
      qty
    }
    items_count
    sharing_code
  }
}

Expected result

    "data": {
        "wishlist": {
            "items": null,
            "items_count": null,
            "sharing_code": null
        }
    }

Actual result

{
    "errors": [
        {
            "debugMessage": "Missing key \"model\" in Wishlist value data",
            "message": "Internal server error",
            "category": "internal",
            "locations": [
                {
                    "line": 3,
                    "column": 5
                }
            ],
            "path": [
                "wishlist",
                "items"
            ]
        }
    ],
    "data": {
        "wishlist": {
            "items": null,
            "items_count": null,
            "sharing_code": null
        }
    }
}

Additional information

This seems to be in vendor/magento/module-wishlist-graph-ql/Model/Resolver/WishlistResolver.php:63 where it returns an empty array, but instead it expects to have a model set for each item even with an empty array.

Release note

No response

Triage and priority

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Area: ProductComponent: WishlistIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P2A defect with this priority could have functionality issues which are not to expectations.Progress: PR in progressProject: GraphQLReported on 2.4.5-p1Indicates original Magento version for the Issue report.Reproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions