Back to Main Site

Perfex CRM GraphQL Guide: Flexible Data Querying Explained

Last updated on Aug 23, 2026 2:24 PM 2:24 PM 1,434.93 ms

Why GraphQL for CRM

Traditional REST APIs return fixed data structures. GraphQL lets you request exactly the fields you need in a single query. For CRM data with dozens of tables and relationships, this means fewer requests and smaller payloads.

Single Endpoint

POST https://databuilder.polyxgo.com/api/v1/graphql
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN

Querying Data

# List staff with specific fields
{
  staffs(limit: 10) {
    id firstname lastname email
  }
}

# Filter and sort
{
  invoices(limit: 5, sort: "-total", filter: "status:2") {
    id total status datecreated
  }
}

# Multiple resources in one request
{
  clients(limit: 5) { userid company }
  projects(limit: 5, sort: "-id") { id name }
  tasks(limit: 10, filter: "status:1") { id name }
}

Mutations: Create, Update, Delete

GraphQL mutations provide full CRUD operations with auto-generated input types:

# Create a new project
mutation {
  createProject(input: {
    name: "API Integration Project"
    clientid: 42
    start_date: "2026-05-01"
  }) {
    id name clientid
  }
}

# Update a task
mutation {
  updateTask(id: 603, input: {
    name: "Updated task name"
    status: 2
  }) {
    id name status
  }
}

# Delete a record
mutation {
  deleteExpense(id: 15) {
    success message
  }
}

Write operations require a token with write scope and per-table permissions. Security columns (passwords, tokens, salts) are automatically excluded from input types.

When to Use GraphQL vs REST

Use Case Best Choice Why
Mobile apps GraphQL Minimize data transfer, single request
Automation (Zapier/Make) REST Simpler webhook payloads
Dashboards GraphQL Multi-resource queries
Simple CRUD REST Familiar HTTP methods
Polling sync REST ?since= parameter
WordPress integration Either Both work with fetch()

For a detailed comparison, see REST vs GraphQL in Perfex CRM.

Security and Limits

  • Query depth limit - prevents deeply nested queries

  • Complexity scoring - blocks expensive queries

  • Token scopes - control which tables and operations are accessible

  • RFC 9457 errors - standardized error responses

Data Builder — Visual Reporting, REST API & GraphQL for Perfex CRM

Create powerful cross-module reports in Perfex CRM — no SQL, just a visual builder for datasets, filters, and charts.

Transform Perfex CRM into an API-first platform with unified GraphQL and REST APIs for core Perfex CRM tables, custom datasets, reports, and third-party module data.
Secure and scale your data workflows with granular permissions, tokenized access control, and reusable API-driven data assets.