# How to filter content using dynamic slug

**URL:** <https://forum.builder.io/t/how-to-filter-content-using-dynamic-slug/15054>\
**Category:** Technical Questions\
**Tags:** graphql, react, nextjs\
**Created:** [June 4, 2025, 4:13pm UTC](https://forum.builder.io/t/how-to-filter-content-using-dynamic-slug/15054 "2025-06-04T16:13:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahk](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@sahk](https://forum.builder.io/u/sahk)\
**Post date:** [June 4, 2025, 4:13pm UTC](https://forum.builder.io/t/how-to-filter-content-using-dynamic-slug/15054/1 "2025-06-04T16:13:24Z")

</div>

I am trying to fetch the content from the model using graphql (Next JS). I want to filter results by slug. In the playground I was able to do it but if I pass it dynamically in the code it throws error,

> `There was an error processing your request`  
> I tried in postman as well but it’s showing the same error.

**Reproducible code example**

```auto
curl --location 'https://cdn.builder.io/api/v3/graphql/{api-key}' \
--header 'Content-Type: application/json' \
--data '{
  "query": "query GetAizleSiteArticles($slug: String!) { aizleSiteArticles(query: { data: { slug: $slug } }) { data { id slug title } } }",
  "variables": {
    "slug": "my-slug"
  }
}'

```

Help will be much appreciated xx

---

<div class="post-metadata">

**Author:** ![veronikapilipenko](https://avatars.discourse-cdn.com/v4/letter/v/90ced4/32.png) [@veronikapilipenko](https://forum.builder.io/u/veronikapilipenko)\
**Post date:** [June 4, 2025, 4:29pm UTC](https://forum.builder.io/t/how-to-filter-content-using-dynamic-slug/15054/2 "2025-06-04T16:29:10Z")

</div>

Hi!

Could you share your API key? It’s a read-only key.

Thanks!
