Getting incorrect data responses when querying products by product type in graphiql app

rojrun
New Member
3 0 0

I did a products query by $product_type. But I'm getting a mix of incorrect productTypes. Here is my query with variables, and the data response:

 

query getProductType($product_type: String!) {
  products(query: $product_type, first:20) {
    edges {
      node {
        title
        productType
      }
    }
  }
}


{
  "product_type": "headphone"
}

 

  

 

{
  "data": {
    "products": {
      "edges": [
        {
          "node": {
            "title": "Audio-Technica ATH-M20x",
            "productType": "headphone"
          }
        },
        {
          "node": {
            "title": "Audio-Technica ATH-M30x",
            "productType": "headphone"
          }
        },
        {
          "node": {
            "title": "Audio-Technica ATH-M40x",
            "productType": "headphone"
          }
        },
        {
          "node": {
            "title": "Audio-Technica ATH-M50x",
            "productType": "headphone"
          }
        },
        {
          "node": {
            "title": "Audio-Technica ATH-M60x",
            "productType": "headphone"
          }
        },
        {
          "node": {
            "title": "Audio-Technica ATH-M70x",
            "productType": "headphone"
          }
        },
        {
          "node": {
            "title": "Audio-Technica AT2020 Microphone",
            "productType": "microphone"
          }
        },
        {
          "node": {
            "title": "Audio-Technica AT2020USB+ Microphone",
            "productType": "microphone"
          }
        },
        {
          "node": {
            "title": "Audio-Technica ATH-R70 Headphones",
            "productType": "headphone"
          }
        },
        {
          "node": {
            "title": "Audio-Technica ATH-PACK4 Professional Headphones Pack",
            "productType": "headphone"
          }
        },
        {
          "node": {
            "title": "Audio-Technica ATH-PACK5 Professional Headphones Pack",
            "productType": "headphone"
          }
        },
        {
          "node": {
            "title": "Audio-Technica ATH-E40 In-Ear Headphones",
            "productType": "in-ear"
          }
        },
        {
          "node": {
            "title": "Audio-Technica ATH-E50 In-Ear Headphones",
            "productType": "in-ear"
          }
        },
        {
          "node": {
            "title": "Audio-Technica ATH-E70 In-Ear Headphones",
            "productType": "in-ear"
          }
        },
        {
          "node": {
            "title": "AKG K72 Headphones",
            "productType": "headphone"
          }
        },
        {
          "node": {
            "title": "Allen & Heath ZED-14 Analog Mixer (Factory Re-Certified)",
            "productType": "audio mixer"
          }
        },
        {
          "node": {
            "title": "Audio-Technica AT2005USB Microphone",
            "productType": "microphone"
          }
        },
        {
          "node": {
            "title": "Allen & Heath ZED60-10FX Analog Mixer (Open Box)",
            "productType": "audio mixer"
          }
        },
        {
          "node": {
            "title": "Sennheiser ew IEM G4-TWIN-G Wireless In-Ear Monitor System (Re-Certified)",
            "productType": "in-ear"
          }
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 22,
      "actualQueryCost": 21,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 979,
        "restoreRate": 50
      }
    }
  }
}

 

  

0 Likes