Finding the UserEvent type in your schema

To learn about what a schema is and how to edit it, checkout the schema section in our user guide.

What we need to look at is the UserEvent (or the type that mirrors UserEvent). For instance you could have something like this:

type UserPoint  @TreeIndexRoot(index:"USER_INDEX") {
    id:ID!
    segments:[UserSegment!]!
    agents:[UserAgent!]!
    creation_date:Date! @Function(params:["creation_ts"], name:"ISODate")
    creation_ts:Timestamp! @TreeIndex(index:"USER_INDEX")
    activities:[UserActivity!]!
}

type UserActivity  {
    id:ID! @TreeIndex(index:"USER_INDEX")
    duration:Int @TreeIndex(index:"USER_INDEX")
    ts:Timestamp! @TreeIndex(index:"USER_INDEX")
    events:[UserEvent!]!
}

type UserEvent  {
   ts:Timestamp! @TreeIndex(index:"USER_INDEX")
   name:String! @TreeIndex(index:"USER_INDEX")
   id:ID! @TreeIndex(index:"USER_INDEX")
}

or something like this:

type UserPoint  @TreeIndexRoot(index:"USER_INDEX") {
    id:ID!
    segments:[UserSegment!]!
    agents:[UserAgent!]!
    creation_date:Date! @Function(params:["creation_ts"], name:"ISODate")
    creation_ts:Timestamp! @TreeIndex(index:"USER_INDEX")
    events:[ActivityEvent!]!
}

type ActivityEvent  @Mirror(object_type:"UserEvent") {
    id:ID! @TreeIndex(index:"USER_INDEX")
    ts:Timestamp! @TreeIndex(index:"USER_INDEX")
    name:String! @TreeIndex(index:"USER_INDEX")
}

In the first case, we will look at the UserEvent object, in the second case, the ActivityEvent object that mirrors the UserEvent object type.

If you don't have an UserEvent type or a type which mirrors it, again, feel free to checkout the schema section in our user guide.

Last updated