GraphQL to GraphStore
- Last UpdatedJul 09, 2025
- 2 minute read
The examples below show how common GraphQL where clauses are translated into GraphStore queries.
Name starts with "pump"
where: { name: { startsWith: "pump" } }
new PropertyFilter
{
PropertyId = "name",
Operation = EntityFilterOperation.StartsWith,
TypeCode = TypeCode.String,
Value = "pump",
}
Name ends with "fl"
where: { name: { endsWith: "fl" } }
new PropertyFilter
{
PropertyId = "name",
Operation = EntityFilterOperation.EndsWith,
TypeCode = TypeCode.String,
Value = "fl",
}
Manufacturer starts with "Big pump company"
where: { properties: [ { id: "Manufacturer", stringValue: { startsWith: "Big pump company" } } ] }
new PropertyFilter
{
PropertyId = "Manufacturer",
Operation = EntityFilterOperation.StartsWith,
TypeCode = TypeCode.String,
Value = "Big pump company",
}
Max pressure greater than 200
where: { properties: [ { id: "maxPressure", numberValue: { gt: 200 } } ] }
new PropertyFilter
{
PropertyId = "maxPressure",
Operation = EntityFilterOperation.GreaterThan,
TypeCode = TypeCode.Double,
Value = 200,
}
Multiple properties
where: {
name: { startsWith: "HEPA-C" }
properties: [
{ id: "class", stringValue: { startsWith: "process col" } }
{ id: "installWeight", numberValue: { gt: 100, uom: "kg" } }
]
}
List<Filter> filters =
[
new PropertyFilter
{
PropertyId = "name",
Operation = EntityFilterOperation.StartsWith,
TypeCode = TypeCode.String,
Value = "HEPA-C",
},
new PropertyFilter
{
PropertyId = "class",
Operation = EntityFilterOperation.StartsWith,
TypeCode = TypeCode.String,
Value = "process col",
},
new PropertyFilter
{
PropertyId = "installWeight",
Operation = EntityFilterOperation.GreaterThan,
TypeCode = TypeCode.Double,
Value = 100,
Uom = "kg",
},
]
Entities with a "Temperature" property
where: { properties: [ { id: "Temperature" } ] }
new DiscoveryFilter
{
Operation = DiscoveryFilterOperation.HasPropertyId,
Value = "Temperature",
}
Entity relationship
where: { relationships: [ { targetBase: ENTITY, values: ["pisrv.line1.pump101"] } ] }
new RelationshipFilter
{
TargetBase = TargetBase.Entity,
Values = new List<string> { "pisrv.line1.pump101" },
}
Single component
where: {
components: [
{
typeId: "EquipmentRegister"
properties: [ { id: "class", stringValue: { startsWith: "process col" } } ]
relationships: [ { id: "HasArea", targetBase: ENTITY, values: ["HEFA-A002"]
} ]
}
]
}
List<Filter> filters =
[
new PropertyFilter
{
TypeId = "EquipmentRegister",
PropertyId = "class",
Operation = EntityFilterOperation.StartsWith,
TypeCode = TypeCode.String,
Value = "process col",
},
new RelationshipFilter
{
TypeId = "EquipmentRegister",
RelationshipId = "HasArea",
TargetBase = TargetBase.Entity,
Values = new List<string> { "HEFA-A002" },
},
]
Multiple components
where: {
components: [
{
typeId: "pump"
properties: [ { id: "headPressure", numberValue: { le: 100, uom: "N" } } ]
},
{
typeId: "equipment"
relationships: [ { id: "has_plant", targetBase: ENTITY, values: ["HEFA"] } ]
}
]
}
List<Filter> filters =
[
new PropertyFilter
{
TypeId = "pump",
PropertyId = "headPressure",
Operation = EntityFilterOperation.LessThanOrEquals,
TypeCode = TypeCode.Double,
Value = 100,
Uom = "N",
},
new RelationshipFilter
{
TypeId = "equipment",
RelationshipId = "has_plant",
TargetBase = TargetBase.Entity,
Values = new List<string> { "HEFA" },
},
]
Component discovery
where: { components: [ { typeId: "Pump" } ] }
new DiscoveryFilter
{
Operation = DiscoveryFilterOperation.HasComponent,
Value = "Pump",
}