Graphql Query Not working in Shopify CLI PHP App

Graphql Query Not working in Shopify CLI PHP App

amanbatra
Shopify Partner
104 14 17

Hello,

 

I am trying to make a grapghql api call using this tutorials
https://github.com/Shopify/shopify-api-php/blob/main/docs/usage/graphql.md

 

But when I make the request I get this error for each call, could any please help me with what I can doing wrong. Attaching the log file and code screenshot https://prnt.sc/OBaUW4_YADyV this screenshot is from my fresh app as I can not share the real app code.

 

The error is:

{
  "errors": [
    {
      "message": "Variable $input of type ProductInput! was provided invalid value",
      "locations": [
        {
          "line": 1,
          "column": 24
        }
      ],
      "extensions": {
        "value": [
          {
            "title": "TARDIS"
          },
          {
            "descriptionHtml": "Time and Relative Dimensions in Space"
          },
          {
            "productType": "Time Lord technology"
          }
        ],
        "problems": [
          {
            "path": [],
            "explanation": "Expected [\"{\\\"title\\\"=>\\\"TARDIS\\\"}\",\"{\\\"descriptionHtml\\\"=>\\\"Time and Relative Dimensions in Space\\\"}\",\"{\\\"productType\\\"=>\\\"Time Lord technology\\\"}\"] to be a key-value object responding to `to_h` or `to_unsafe_h`."
          }
        ]
      }
    }
  ]
}

 

Thanks in advance.

 

Regards

Aman Batra

 

Is the solution works for you ? please Like and Accept Solution.
Need more help with theme customization and store development ?
WA: +917508271396, Email: [email protected], Skype: amanbatra.developer
Replies 0 (0)