OTQL examples
This page provides examples of OTQL queries, based on simplified schemas. The objective is to be less technical and illustrate how works our language by different use cases.
Basic queries
Schema example
type UserPoint {
id : ID!
activities : [UserActivity!]!
profiles : [UserProfile!]!
}
type UserActivity {
id : ID!
events : [UserEvent!]!
}
type UserEvent {
id : ID!
name : String
}
type UserProfile {
id : ID!
age : String
}
The different steps of an OTQL query


Same explanation with multiple userpoints


SELECT only be apply in userpoint still in the list, after the WHERE filterChange the scope of your query
Use FROM to chose your execution context



Get condition on different sub-object Tree

Add a condition from another Object Tree

WHERE clause 
WHERE 
Scoring operator
Use case : Count UserPoint who bought more than X€ of product of the IT category
Use case : Count UserPoint who bought in average more than X€ of product of the IT category
Use case : Count UserPoint who bought more than X€ of product of the IT or Book category
Date operators
Filters
Last updated
Was this helpful?