Nextjs Strapi Graphql Dynamic Routes

I’m trying to create a dynamic route and I’m having the following error:

Error: A required parameter (slug) was not provided as a string in getStaticPaths for /roupas/[slug]

This is my Query:
const GET_CARDS = gql`

query Get_Cards {
cards{
data{
id
attributes{
slug
titulo
image{
data{
attributes{url
}
}
description
valor
}
}
}
}

`

what’s the error?

when I click on the link to generate the dynamic page, I go to this error screen!

You have problems with getting the slugs, what are you retrieving from Strapi?

This is my Query for slug

const GET_CARD_BY_SLUG = gql `
query GET_CARD_SLUG($slug:String){
    cards(filters:{slug:{eq:$slug}}){
      data{
        attributes{
          titulo
          slug
          description
          valor
          image{
            data{
              attributes{url}
            }
          }
        }
      }
    }
    
  }
`

`
schema on grapgql

Here it says the slug parameter is missing, which means, your function does not receive a slug, check it!

There is no problem with your query, there problem is in the route itself: the route is undefined, check all the slugs first.