Resolver function with condition

I have an ecto schema of Post as follows

schema "posts" do
 field :title, :string
 field :body, :string
 field :publish_date, :date 
 has_many  :comments, MyRepo.Blogs.Comments.Comment

GQL schema

mutation do
field :delete_post, type: :blog_post do
        arg(:post, :struct)

My question is how do I write a resolver function in such a way that I delete posts that are only published,. i.e posts that have a publish_date (non-null value).

Would you consider putting the condition in MyRepoWeb.Schema.Resolvers.Posts.delete_post/1?

Is there any issue using pattern matching in the resolver function? Let me know.