Queries

Use queries to retrieve data from the API.

Getting an instance of a Type

Individual types can be queried to get a single instance, usually by passing an ID as a parameter to the query. For example, to get a single User:

query {
  User(id: "1") {
    id
    name
  }
}

Getting Metadata (count)

The _all...Meta and _flexSearch...Meta queries get metadata about all the entities of a given type or based on the flex search results. Generally, count is the only available property that can be queried. Note, you CAN use filters pagination with these queries.

For example, to get the metadata for all Users:

query {
  _allUsersMeta {
    count
  }
}

Getting collections of a Type

The all... queries get all the entities of a given type. You can use filters and pagination with these queries.

For example, to get all Users:

query {
  allUsers {
    id
    name
  }
}

Searching for instances of a Type

The flexSearch... queries search for specified types that match the given search criteria. You can use filters and pagination with these queries.

For example, to search for all Users with a name that contains "John":

query {
  flexSearchUsers(filter: { name: { contains: "John" } }) {
    id
    name
  }
}

All Queries

This page was generated: 2024-05-17