Files
Krow-workspace/backend/dataconnect/connector/costCenter/queries.gql

48 lines
1013 B
GraphQL

# ----------------------------------------------------------
# LIST ALL COST CENTERS
# ----------------------------------------------------------
query listCostCenters(
$offset: Int
$limit: Int
) @auth(level: USER) {
costCenters(offset: $offset, limit: $limit) {
id
name
createdAt
updatedAt
createdBy
}
}
# ----------------------------------------------------------
# GET BY ID
# ----------------------------------------------------------
query getCostCenterById($id: UUID!) @auth(level: USER) {
costCenter(id: $id) {
id
name
createdAt
updatedAt
createdBy
}
}
# ----------------------------------------------------------
# GET COST CENTER LINKED TO A SPECIFIC HUB
# ----------------------------------------------------------
query getCostCenterByHubId($hubId: UUID!) @auth(level: USER) {
hubs(where: { id: { eq: $hubId } }) {
id
name
costCenterId
costCenter {
id
name
createdAt
updatedAt
createdBy
}
}
}