Skip to content
This repository was archived by the owner on Dec 19, 2019. It is now read-only.
This repository was archived by the owner on Dec 19, 2019. It is now read-only.

Cannot return null for non-nullable field CartItemQuantity.cart_item_id. #822

@TomashKhamlai

Description

@TomashKhamlai

Preconditions (*)

  1. Simple Product 1 has IN_STOCK status

Steps to reproduce (*)

  1. Add "Simple Product 1" to Cart
  2. Set shipping address on Cart
  3. Set the shipping method on Cart
  4. Try to set "email" on Cart and check some details in the Shipping addresses subselection
mutation {
  setGuestEmailOnCart(input:{
    cart_id: " {{guest_cart_id}} "
    email: "John.Doe@gmail.com"
  }){
     cart {
      email
      shipping_addresses {
        cart_items {
          cart_item_id
          quantity
        }
        items_weight
        selected_shipping_method {
          method_title
          
        }
        available_shipping_methods {
          carrier_code
          method_code
        }
      }
    }
  }
}

Expected result (*)

  1. It seems like it was working without exception until there were only downloadable products. So at least it should return null and no exception.
  2. Works as expected

Actual result (*)

  1. Error
{
  "errors": [
    {
      "debugMessage": "Cannot return null for non-nullable field CartItemQuantity.cart_item_id.",
      "message": "Internal server error",
      "category": "internal",
      "locations": [
        {
          "line": 6,
          "column": 11
        }
      ],
      "path": [
        "setGuestEmailOnCart",
        "cart",
        "shipping_addresses",
        0,
        "cart_items",
        0,
        "cart_item_id"
      ]
    }
  ],
  "data": {
    "setGuestEmailOnCart": {
      "cart": {
        "shipping_addresses": [
          {
            "cart_items": [
              null
            ],
            "items_weight": 1,
            "selected_shipping_method": {
              "method_title": "Fixed"
            },
            "available_shipping_methods": [
              {
                "carrier_code": "flatrate",
                "method_code": "flatrate"
              }
            ]
          }
        ]
      }
    }
  }
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions