Homepage

HasUsersInterface

Last edit: Oct 13, 2026

Object that can load related users

interface HasUsersInterface {
  related_user(
    filter: UsersFilterInput
    foreign_property: String = "id"
    join_on_property: String = "user_id"
    sort: [UsersSortInput!]
  ): User
  related_users(
    filter: UsersFilterInput
    foreign_property: String!
    join_on_property: String!
    limit: Int
    sort: [UsersSortInput!]
  ): [User!]
}

Fields

Returns the user whose foreign_property equals the value of join_on_property
of this object (belongs-to relation); by default the user whose id is in
user_id; ex: invited_by: related_user(join_on_property: "invited_by_id") { id }

Additional conditions the related user must match

Name of the property (or attribute, e.g. id, email, slug or external_id) of
the user that must equal the value of join_on_property

Name of the property (or attribute) of this object whose value is matched
against foreign_property. Must not be an array (use related_users). Returns
an error when this object has no such property

Sort order used to pick the user when several match; the last one is returned

Returns users whose foreign_property equals the value of join_on_property of
this object (has-many relation). Related users of all objects in the result
are loaded in one batch of at most 10,000 users, soft-deleted users are
skipped; ex: members: related_users(join_on_property: "id", foreign_property:
"company_id") { id }

Additional conditions the related users must match

Name of the property (or attribute, e.g. id, email, slug or external_id) of
the user that must equal the value of join_on_property

Name of the property (or attribute, e.g. id) of this object whose value is
matched against foreign_property. When the value is an array, users matching
any of its elements are returned. Returns an error when this object has no such property

Maximum number of related objects returned for each object

Sort order of the results. When several entries are given, they are applied in the given order

Questions?

We are always happy to help with any questions you may have.

contact us