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

[Customizable Options] Call to a member function format() on boolean #761

Closed
TomashKhamlai opened this issue Jul 3, 2019 · 2 comments
Closed

Comments

@TomashKhamlai
Copy link
Contributor

Preconditions (*)

  1. Simple Product is created:
    SKU: simple-product-1
    qty: 100500
    Customizable options:
    type: date

Steps to reproduce (*)

  1. Perform query for Customer and use header
    Header:
{
  "Authorization": "Bearer {{ CUSTOMER_TOKEN }}"
}

Query:

mutation {
  addSimpleProductsToCart(
    input: {
      cart_id: "{{ CART_ID }}"
      cart_items: {
        data: {
          quantity: 1
          sku: "simple-product-3"
        }
        customizable_options: [
          {
            id: 1
            value_string: "12-12-12"
          }
        ]
      }
    }
  ) {
    cart {
      items {
        quantity
        product {
          sku
        }
      }
    }
  }
}

Expected result (*)

  1. Product was added to cart

Actual result (*)

  1. Error:
{
  "errors": [
    {
      "debugMessage": "Call to a member function format() on boolean",
      "message": "Internal server error",
      "category": "internal",
      "locations": [
        {
          "line": 2,
          "column": 3
        }
      ],
      "path": [
        "addSimpleProductsToCart"
      ]
    }
  ],
  "data": {
    "addSimpleProductsToCart": null
  }
}
@sedonik
Copy link
Contributor

sedonik commented Jul 8, 2019

Hi @TomashKhamlai,

I've created PR with changes to the code. It should fix the problem. Please check.

Thanks.

@lenaorobei
Copy link
Contributor

@TomashKhamlai we discussed this issue with @naydav and think that the expected behaviour here is the error message like Invalid format provided. Please use 'Y-m-d' for 'date' type. The same for date-time and time. It looks more obvious than format data and guess its type under the hood.

lenaorobei added a commit to sedonik/graphql-ce that referenced this issue Oct 14, 2019
lenaorobei added a commit to sedonik/graphql-ce that referenced this issue Oct 14, 2019
lenaorobei added a commit to sedonik/graphql-ce that referenced this issue Oct 14, 2019
lenaorobei added a commit to sedonik/graphql-ce that referenced this issue Oct 14, 2019
lenaorobei added a commit to sedonik/graphql-ce that referenced this issue Oct 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants