151 lines
2.1 KiB
GraphQL
151 lines
2.1 KiB
GraphQL
|
|
# ==========================================================
|
|
# TEAM HUB - QUERIES (USE where, NOT filter)
|
|
# Include ALL fields in TeamHub
|
|
# ==========================================================
|
|
|
|
query listTeamHubs($offset: Int, $limit: Int) @auth(level: USER) {
|
|
teamHubs(offset: $offset, limit: $limit, orderBy: { createdAt: DESC }) {
|
|
id
|
|
teamId
|
|
costCenterId
|
|
hubName
|
|
|
|
address
|
|
placeId
|
|
latitude
|
|
longitude
|
|
|
|
city
|
|
state
|
|
street
|
|
country
|
|
zipCode
|
|
|
|
managerName
|
|
isActive
|
|
departments
|
|
costCenter {
|
|
id
|
|
name
|
|
businessId
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
query getTeamHubById($id: UUID!) @auth(level: USER) {
|
|
teamHub(id: $id) {
|
|
id
|
|
teamId
|
|
costCenterId
|
|
hubName
|
|
|
|
address
|
|
placeId
|
|
latitude
|
|
longitude
|
|
|
|
city
|
|
state
|
|
street
|
|
country
|
|
zipCode
|
|
|
|
managerName
|
|
isActive
|
|
departments
|
|
costCenter {
|
|
id
|
|
name
|
|
businessId
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
query getTeamHubsByTeamId(
|
|
$teamId: UUID!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
teamHubs(
|
|
where: { teamId: { eq: $teamId } }
|
|
offset: $offset
|
|
limit: $limit
|
|
orderBy: { createdAt: DESC }
|
|
) {
|
|
id
|
|
teamId
|
|
costCenterId
|
|
hubName
|
|
|
|
address
|
|
placeId
|
|
latitude
|
|
longitude
|
|
|
|
city
|
|
state
|
|
street
|
|
country
|
|
zipCode
|
|
|
|
managerName
|
|
isActive
|
|
departments
|
|
costCenter {
|
|
id
|
|
name
|
|
businessId
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
# ------------------------------------------------------------
|
|
# LIST TEAM HUBS BY OWNER (Vendor/Business)
|
|
# ------------------------------------------------------------
|
|
query listTeamHubsByOwnerId(
|
|
$ownerId: UUID!
|
|
$offset: Int
|
|
$limit: Int
|
|
) @auth(level: USER) {
|
|
teamHubs(
|
|
where: {
|
|
team: {
|
|
ownerId: { eq: $ownerId }
|
|
}
|
|
}
|
|
offset: $offset
|
|
limit: $limit
|
|
orderBy: { createdAt: DESC }
|
|
) {
|
|
id
|
|
teamId
|
|
costCenterId
|
|
hubName
|
|
|
|
address
|
|
placeId
|
|
latitude
|
|
longitude
|
|
|
|
city
|
|
state
|
|
street
|
|
country
|
|
zipCode
|
|
|
|
managerName
|
|
isActive
|
|
departments
|
|
costCenter {
|
|
id
|
|
name
|
|
businessId
|
|
}
|
|
|
|
}
|
|
}
|