query GetProducts(
	$businessId: ID!
	$page: Int
	$pageSize: Int
	$sort: [ProductSort!]! = [NAME_ASC]
	$isSold: Boolean
	$isBought: Boolean
	$isArchived: Boolean
) {
	business(id: $businessId) {
		id
		products(
			page: $page
			pageSize: $pageSize
			sort: $sort
			isSold: $isSold
			isBought: $isBought
			isArchived: $isArchived
		) {
			edges {
				node {
					id
					name
					description
					unitPrice
					isSold
					isBought
					isArchived
					incomeAccount {
						id
						name
					}
					expenseAccount {
						id
						name
					}
					defaultSalesTaxes {
						id
						name
						abbreviation
					}
					createdAt
					modifiedAt
				}
			}
			pageInfo {
				currentPage
				totalPages
				totalCount
			}
		}
	}
}

query GetProduct($businessId: ID!, $productId: ID!) {
	business(id: $businessId) {
		id
		product(id: $productId) {
			id
			name
			description
			unitPrice
			isSold
			isBought
			isArchived
			incomeAccount {
				id
				name
				type {
					name
					value
				}
				subtype {
					name
					value
				}
			}
			expenseAccount {
				id
				name
				type {
					name
					value
				}
				subtype {
					name
					value
				}
			}
			defaultSalesTaxes {
				id
				name
				abbreviation
				rate
			}
			createdAt
			modifiedAt
		}
	}
}
