– C

mutation {
  createTodo(
    data: {
      label: "test (created by gql)"
      priority: 1
      tg_chat_id: 123
      namespace: "tst ns"
      status: no_status
    }
  ) {
    data {
      id
      attributes {
      	label
      	description
      	priority
      	status
      	tg_chat_id
        namespace
      }
    }
  }
}

– R

query {
  todos: todos(
    filters: {
      tg_chat_id: {
        eq: 123
      }
    }
  ) {
    data {
      id
      attributes {
      	label
      	description
      	priority
      	status
      	tg_chat_id
        namespace
      }
    }
  }
}

With filter & sort & pagination

query {
  todos: todos(
    filters: {
      tg_chat_id: {
        eq: 123
      }
    }
    sort: ["priority:desc", "updatedAt:asc"]
    pagination: {
      page: 1
      pageSize: 100
    }
  ) {
    data {
      id
      attributes {
      	label
      	description
      	priority
      	status
      	tg_chat_id
        namespace
      }
    }
    meta {
      pagination {
        page
        pageSize
        pageCount
        total
      }
    }
  }
}

– U

mutation {
  updateTodo(
    id: 1
    data: {
      label: "tst EDITED"
    }
  ) {
    data {
      id
      attributes {
      	label
      	description
      	priority
      	status
      	tg_chat_id
        namespace
      }
    }
  }
}

– D

mutation {
  deleteTodo(
    id: 1
  ) {
    data {
      id
      attributes {
      	label
      	description
      	priority
      	status
      	tg_chat_id
        namespace
      }
    }
  }
}

pravosleva.pro / strapi.backend