Skip to content

Join using FrontQL

Introduction

In web applications, it is common to join data from multiple collections. FrontQL provides the ability to join data using the join query parameter.

Implementing Join

  • The join query parameter is used to specify the collection(s) to join.

Example

Here’s a simple example of implementing join using FrontQL:

async function getUsers() {
const response = await Api.get("/users", {
join: "posts:post",
});
return response;
}

In this example, the join query parameter is used to specify that the users collection should be joined with the posts collection. The join is done on the post field in the users collection, which corresponds to the id field in the posts collection.