I'd like to use an array inside a GraphQL query variable so that I can get the data of more than one product from a single query with Gatsby however at the moment I get errors.
My graphQL query looks like:
query ($id: [String!]) {
shopifyProduct(handle: {eq: $id}) {
handle
id
title
handle
productType
shopifyId
}
}
and my Query Variable looks like:
{
"id": ["liner-jacket", "pocket-t-shirt"]
}
The desired response would be (something like):
{
"data": {
"shopifyProduct": {
"handle": "liner-jacket",
"id": "Shopify__Product__hopbjidjoqjndadnawdawda123123=",
"title": "Liner Jacket",
"productType": "jacket",
"shopifyId": "hopbjidjoqjndadnawdawda123123="
},
"shopifyProduct": {
"handle": "pocket-t-shirt",
"id": "Shopify__Product__iajwdoiajdoadjwaowda4023123=",
"title": "Pocket T-Shirt",
"productType": "t-shirt",
"shopifyId": "iajwdoiajdoadjwaowda4023123="
}
}
}