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

i want to do the same thing that he does on the video but for graphql

anyone find solution for this in graphql?

// api/post/config/schema.graphql.js

module.exports = {
  query: "postBySlug(slug: String!): Post",
  resolver: {
    Query: {
      postBySlug: {
        description: "Return post with given slug",
        resolver: 'application::post.post.findOne'
      },
    },
  },
};

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

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