Cirqll Core
HomeCirqll
HomeCirqll
  1. Query Parameters
  • Query Parameters
    • Eager Loading
    • Partial Data
    • Count Relations
    • Pagination
      • Filter
      • Order By
  • Authentication
    • OAuth2
      • Authorize
        • Authorize
      • User
        • Me
      • Client
        • Index
        • Create
        • Update
        • Delete
      • Token
        • Create
        • Refresh
        • Index
      • Scopes
  • User
    • Index
      GET
    • Show
      GET
    • Create
      POST
    • Update
      PATCH
    • Delete
      DELETE
  • Role
    • Index
      GET
    • Show
      GET
    • Create
      POST
    • Update
      PATCH
    • Delete
      DELETE
  • Customer
    • Index
      GET
    • Show
      GET
    • Create
      POST
    • Update
      PATCH
    • Delete
      DELETE
  • Contact
    • Index
      GET
    • Show
      GET
    • Create
      POST
    • Update
      PATCH
    • Delete
      DELETE
  • Appointment
    • Index
    • Show
    • Create
    • Update
    • Delete
  • Task
    • Index
    • Show
    • Create
    • Update
    • Delete
  • Financial
    • Chance
      • Index
      • Show
      • Create
      • Update
      • Delete
    • Assignment
      • Index
      • Show
      • Create
      • Update
      • Delete
    • Contract
      • Index
      • Show
      • Create
      • Update
      • Delete
  • Email
    • Index
    • Show
    • Create
    • Update
    • Delete
  • Field
    • Index
    • Show
    • Create
    • Update
    • Delete
  • Note
    • Index
    • Show
    • Create
    • Update
    • Delete
  • To-do
    • Index
    • Show
    • Create
    • Update
    • Delete
  • Template
    • Index
    • Show
    • Update
    • Create
    • Delete
  • Setting
    • Index
    • Update
  • Webhook
    • Index
    • Show
    • Create
    • Update
    • Delete
  1. Query Parameters

Partial Data

Overview#

The show query parameter allows clients to specify which fields should be included in the API response for a given resource. By using this parameter, you can customize the response to include only the fields you need, improving efficiency and reducing payload size.

Usage#

Selecting Single Fields#

To include a specific field in the response, provide the field name as the value of the show query parameter. For example:
GET /api/resource?show=name
Response:
{
  "id": 1,
  "name": "Example Name"
}

Selecting Multiple Fields#

To include multiple fields, you can:
1.
Use a comma-separated list:
GET /api/resource?show=name,description
Response:
{
  "id": 1,
  "name": "Example Name",
  "description": "This is an example description."
}
2.
Use an array-style query:
GET /api/resource?show[]=name&show[]=description
Response:
{
  "id": 1,
  "name": "Example Name",
  "description": "This is an example description."
}

Including Fields from Related Resources#

To include fields from related resources, use dot notation to specify nested fields. This will automatically eager-load the related resources. For example:
GET /api/resource?show=name,company.name
Response:
{
  "id": 1,
  "name": "Example Name",
  "company_id": 2,
  "company": {
    "id": 2,
    "name": "Example Company"
  }
}

Behavior Notes#

The id field of the resource is always included in the response, even if it is not explicitly specified in the show parameter.
Related resources are automatically eager-loaded when their fields are specified using dot notation, ensuring efficient database queries.
Should not be used in conjuction with Eager Loading (with)
Modified at 2025-01-26 13:30:23
Previous
Eager Loading
Next
Count Relations
Built with