Skip to main content

Single Record Query

You can fetch a single record using queries. In the following examples, we have a table called Posts, which contains fields and relations like title, body, author.

Fetching specific table records

You can fetch a single record using the record's id.

Request

query {
post(id: "<POST_ID>") {
id
title
body
}
}

Response

{
"data": {
"post": {
"id": "<POST_ID>",
"title": "Awesome Possum",
"body": "This post is awesome, like a possum!"
}
}
}

Single record queries using unique fields

You can fetch a single record using a unique field other than id. This field must be specified as No Duplicate Values in the table's field definition.

Request

query {
post(title: "Awesome Possum") {
title
body
}
}

Response

{
"data": {
"post": {
"title": "Awesome Possum",
"body": "This post is awesome, like a possum!"
}
}
}