Appearance
Filtering
Many resources can be filtered. Filters can be combined and nested.
graphql
query LargeFloors {
getFloors(where: { area: { gte: 3000 } }) {
floors {
id
name
area
}
}
}Building filter
Properties a building can be filtered by:
ts
{
id: Number
name: StringComparator
createdAt: DateComparator
updatedAt: DateComparator
floors: FloorFilter
}Floor filter
Properties a floor can be filtered by:
ts
{
id: Number
area: NumberComparator
name: StringComparator
createdAt: DateComparator
updatedAt: DateComparator
spaces: SpaceFilter
elements: ElementFilter
customAttribute: CustomAttributeFilter
label: LabelFilter
isPrivate: Boolean
seatCapacity: SeatCapacityFilter
or: [FloorFilter]
and: [FloorFilter]
}Space filter
Properties a space can be filtered by:
ts
{
id: Number
area: NumberComparator
name: StringComparator
program: StringComparator
usage: StringComparator
seatCapacity: NumberComparator
isExternal: Boolean
elements: ElementFilter
customAttribute: CustomAttributeFilter
count: NumberComparator
or: [SpaceFilter]
and: [SpaceFilter]
}Custom attribute filter
Custom attributes can be filtered by:
ts
{
key: StringComparator
value: StringComparator
title: StringComparator
}Example
graphql
query Floors {
getFloors {
floors(
where: {
customAttributes: {
key: { eq: "building-id" },
value: { eq: "ZURICH-01" }
}
}) {
id
name
customAttributes: {
key,
value,
title
}
}
}
}space.program and space.usage follow Space Taxonomy
Adjacent space grouping filter
Properties a space grouping can be identified by:
ts
{
area: NumberComparator
name: StringComparator
program: StringComparator
usage: StringComparator
seatCapacity: NumberComparator
elements: ElementFilter
customAttribute: CustomAttributeFilter
count: Int!
connectivity: Int
adjacentSpaces: AdjacentSpaceFilter
}program and usage follow Space Taxonomycount represents a desired number of adjacent spacesconnectivity represents the <= amount of doors between adjacent spacesadjacentSpaces represents related adjacent spaces following Adjacent Space Filter
Example:
"Find a meeting room next to 2 adjacent private offices which are connected through the same corridor (2 doors)."
graphql
query Floors {
getFloors {
floors {
id
name
adjacentSpaces(
where: {
adjacentSpaces: {
count: 1
usage: { eq: "meetingRoom" }
adjacentSpaces: { count: 2, connectivity: 2, usage: { eq: "privateOffice" } }
}
}
) {
id
name
usage
}
}
}
}Adjacent space filter
Properties an adjacent space can be filtered by:
ts
{
area: NumberComparator
name: StringComparator
program: StringComparator
usage: StringComparator
seatCapacity: NumberComparator
elements: ElementFilter
customAttribute: CustomAttributeFilter
count: Int!
connectivity: Int
}program and usage follow Space Taxonomycount represents a desired number of adjacent spacesconnectivity represents the <= amount of openings (doors) between adjacent spaces
Element filter
Properties of an element can be filtered by:
ts
{
type: StringComparator
count: NumberComparator
product: ProductFilter
dimensions: DimensionFilter
customAttribute: CustomAttributeFilter
isExternal: Boolean
}Product filter
Properties of a product can be filtered by:
ts
{
name: StringComparator
category: StringComparator
subCategory: StringComparator
customAttribute: CustomAttributeFilter
}DimensionFilter
ts
{
length: NumberComparator
width: NumberComparator
height: NumberComparator
}Seat capacity filter
Seat capacity can be filtered by:
ts
{
area: NumberComparator
name: StringComparator
program: StringComparator
usage: StringComparator
seatCapacity: NumberComparator
elements: ElementFilter
customAttribute: CustomAttributeFilter
or: [SpaceFilter]
and: [SpaceFilter]
capacity: NumberComparator
}product.category and product.subCategory follows Product Taxonomy
Comparators
You can use the following comparators on string, numeric, and date fields:
String comparator
| Comparator | description |
|---|---|
| eq | Equals the given value |
| neq | Not equal to the given value |
| in | Value is in the given collection of values |
| nin | Value is not in the given collection of values |
| contains | Contains the given value |
Number comparator
| Comparator | description |
|---|---|
| eq | Equals the given value |
| neq | Not equal to the given value |
| lte | Less than or equal to the given value |
| gte | Greater than or equal to the given value |
Date comparator
| Comparator | description |
|---|---|
| eq | Equals the given value |
| neq | Not equal to the given value |
| lte | Less than or equal to the given value |
| gte | Greater than or equal to the given value |
Optional values additionally support the null comparator, which can be used to return entities depending on whether the field has a value or not. The following query will return all floors that don't have a label:
graphql
query FloorsWithNoLabels {
getFloors(filter: { labels: { null: true } }) {
floors {
id
labels {
title
}
}
}
}Filtering by relationship
You can for instance filter for spaces within the floor filter.
"Show me all floors with two meeting rooms"
graphql
query FloorsWithTwoMeetingRooms {
getFloors(where: { spaces: { program: { eq: "meet" }, count: 2 } }) {
floors {
id
name
area
spaces(where: { program: { eq: "meet" } }) {
id
name
program
}
}
}
}You can query for relations of relations
graphql
query FloorsWith {
getFloors(
where: {
spaces: {
program: { eq: "meet" }
elements: {
type: { eq: "element:asset" }
count: 5
product: { category: { eq: "seating" } }
}
}
}
) {
floors {
id
name
area
}
}
}
