Data API queries

Set up a query for the Data API playground.

Updated over a week ago

After setting up a connection with the Playground, you can start collecting data through queries. In this article, we're looking at some example on how to do this.

For Data API queries we will have to touch these subjects:

  • Data API's query examples

  • Limits on the data API

Note: Connecting through the Playground will also give you an entire list of queries available. This article is meant for examples of different options.

For the examples in this article, we'll be using a Task model. Apply queries for your own implementation using models of your application.

Get all Tasks

This query will return an overview of all Task records, containing the properties' values as configured.

{
allTask {
results {
id
task
}
}
}

Example

Get Tasks with where filter

This query will return an overview of all Task records matching the criteria in the where filter, containing the properties' values as configured.

{
allTask(where: { id : { in: [3, 4]} } ){
results {
id
task
}
}
}

Example

Get one Task

This query will return the first Task record matching the criteria in the where filter, containing the properties' values as configured.

{
oneTask (where: { id : { eq: 3} } ) {
id
task
}
}

Example

Get Tasks sorted in a specific order

This query will return an overview of multiple Task records in an ascending or descending order of the specified property, containing the properties' values as configured. Accepts ASC and DESC

{
allTask(sort: {field: id, order: DESC}) {
results {
id
}
}
}

Example

Get task with relational data

This query will return the first Task record matching the criteria in the where filter, containing the properties' values as configured, including all configured values of a related record.

Note: Make sure the authorization on the relational data is setup properly. The (un)authenticated should be able to query the related data. Otherwise an ‘Unauthorized’ error will be shown.

{
oneTask (id:3) {
id
task
webUser {
id
email
}
}
}

Example

Retrieving file properties

This query will return the Task records matching the criteria in the where filter, containing the properties' values as configured, including the configured File property values (name, URL).

query {
allArtists {
results {
name
songs {
art {
name
url
}
}
}
}
}

Limits on the data API

To make sure that we as a platform and you with your application can work together in perfect harmony, we have defined some limits on the queries made with the data API.

  • Data API read request rate:

    • for live production applications: 100 per minute,

    • for non-live production applications and sandboxes: 50 per minute.

  • Data API request timeout: 60 seconds.

  • Data API database query timeout: 5 seconds.

  • Data API maximum queries per request: 10 queries.

  • Data API maximum nesting of relations inside a query: 4 layers.

  • Applications are allowed to create or update 80 records per minute.

Keep these limits in mind whilst creating your application to make sure your application will run smooth and stable.

➝ Next article: Data API refresh tokens

Did this answer your question?