Filter Links by slug property

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

Hello @gortiz022 looks like you are trying to do something that is still not possible.

Have a look at this feature request: Deep filtering on both CMA and CDA is that what you are trying to do?

In that case you should make two calls, one to get all the categories, filter them by slug and then use the id as a parameter for the query that you are actually trying to do, OK?