I am trying to perform a query using the in operator where the criteria is based on values in an array. How can I perform the query below to take an array and base its in criteria off a variable array? I am using reactjs + gatsby.
... graphql`
query pageHeader {
.... there is another query in the real code above this line
allContentInSites (filter: {slug: {in: ` + JSON.stringify(searchCriteria.map(item => item.value)) + ` }}) {
edges {
node {
title,
link
}
}
}
}'
I was initially thinking the sample code above would pass a json string object for the in criteria but this seems to break the page.