Standalone Type Tables

Standalone type tables are like normal database tables but the number of entries allowed in the table is 1. Essentially are used when you want to limit the number of entries (rows) to one.

These type of tables are used to store data for singular structures. For example, if you want to store data for a single webpage.

In the Graph

Screenshot

Create a Standalone table by simply creating a new table and marking the type as STANDALONE.

In the CMS

Screenshot

When you publish a STANDALONE type table, it's available in the Content Management System where you will be able to add the entry. If you want to view the data entries in your left navigation by any other field name, you can do that by selecting the Viewing by dropdown.

You'll not be able to create more than 1 entry for a STANDALONE type table but can only edit or delete it.

In the API

In the API the output for a standalone type table is an array with the fields inside them as the keys. The array response for a standalone type table will not have more than one object inside it.

Sample GraphQL Request

query {
  users { # Marked as Standalone type Table
    name
    location {
      longitude
      latitude
      city
    }
  }
}

Sample GraphQL Response

{
  "data": {
    "users": [
      {
        "name": "Simranjot",
        "location": [
          {
            "longitude": "-77.0364",
            "latitude": "38.8951",
            "city": "Washington DC"
          }
        ]
      }
    ]
  }
}
Did you find what you were looking for?
👍
👎
What went wrong?
Need more help?We have a thriving Discordcommunity that can help you with all things Canonic. →