# Dynamic Query Operations

Being able to execute query operations dynamically means you're not restricted to the preset CRUD operations.

class Post extends Model{
  static entity = 'Post';
    static dynamicQueryOperations: boolean = true;
    ...
}

...
const response = await Post.where('id', 1)
                    .select(['id', 'title'])
                    .mutation() // query types is by default set to "query"
                    .publishPost()

This will generate and execute the following query.

mutation ($id: Int!) {
  publishPost(id: $id) {
    id
    title
  }
}

With the variables.

{
  "id": 1
}

Note that the above example is the same as the below without dynamic operations enabled.

const response = await Post.where("id", 1)
  .select(["id", "title"])
  .mutate("publishPost");