Graphql how can i replace the required (id: ID!) field with a (slug: String)

I am trying your suggestion in strapi V4, but the query doesn’t get added to /graphql

Cannot query field \"postBySlug\" on type \"Query\".