# Collection domain operations
query GetCollection($id: ID!) {
  collection(id: $id) {
    id
    name
    description
    createdAt
    updatedAt
    works { id name }
    user { id username }
  }
}

query Collections($userId: ID, $limit: Int, $offset: Int) {
  collections(userId: $userId, limit: $limit, offset: $offset) {
    id
    name
    description
    createdAt
    updatedAt
  }
}

mutation CreateCollection($input: CollectionInput!) {
  createCollection(input: $input) {
    id
    name
    description
    createdAt
    updatedAt
  }
}

mutation UpdateCollection($id: ID!, $input: CollectionInput!) {
  updateCollection(id: $id, input: $input) {
    id
    name
    description
    updatedAt
  }
}

mutation DeleteCollection($id: ID!) {
  deleteCollection(id: $id)
}

mutation AddWorkToCollection($collectionId: ID!, $workId: ID!) {
  addWorkToCollection(collectionId: $collectionId, workId: $workId) {
    id
    name
    works { id name }
  }
}

mutation RemoveWorkFromCollection($collectionId: ID!, $workId: ID!) {
  removeWorkFromCollection(collectionId: $collectionId, workId: $workId) {
    id
    name
    works { id name }
  }
}
