This is probably user error, but I’m trying to filter records by a link slug in GraphQL. I have 2 models, Works
and artwork_category
. I’m using artwork_category
as… well… a category. So how can I filter by a link slug, or anything other than an ID?
I’m getting an error message that says "InputObject 'LinkFilter' doesn't accept argument 'slug'"
It looks like I can only filter links by ID, but what I really need to filter by the slug of the link I have created because I’m going to use the slug in my Next.js dynamic routing. So the goal is I could make a URL path that looks like this artwork/[category]
. ------> artwork/commissions
, artwork/portraits
In the API Explorer I’ve tried this:
query MyQuery {
allWorks(filter: {artworkCategory: {slug: {eq: "commissions"}}}, orderBy: artworkTitle_DESC) {
updatedAt
artworkImage {
url
title
tags
width
}
artworkTitle
artworkYear
createdAt
id
artworkDescription
artworkCategory {
...ArtworkCategoryRecordFragment
}
}
_allWorksMeta {
count
}
}
fragment ArtworkCategoryRecordFragment on ArtworkCategoryRecord {
id
slug
categoryName
_createdAt
_status
}
Thank you so much for any help/advice