I am migrating a project from Gatsby to NextJS and I am having an issue with a query
In Gatsby I was able to do this:
query($slug: String!) {
allDatoCmsArticle(
filter: { category: { elemMatch: { slug: { eq: $slug } } } }
sort: { fields: date, order: DESC }
) {
edges {
node {
title
id
slug
date(formatString: "MMM DD, YY")
contentNode {
childMarkdownRemark {
excerpt(truncate: true, pruneLength: 300)
html
}
}
}
}
totalCount
}
datoCmsCategory(slug: { eq: $slug }) {
title
}
}
To get all the articles under certain category, but this doesnt seem to be working with next js, it says
"message": "InputObject 'LinksFilter' doesn't accept argument 'elemMatch'",
any idea how to do this? I am trying to list all articles under certain category in pages/categories/[slug].js