smithery.ai

query-data

Expert guide to the auto-generated GraphQL API (Queries, Mutations, Aggregations).

First seen Mar 20, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 3,144 B
  • docs SUMMARY.md 100 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Query Data Skill

1. Naming Conventions

The Platform auto-generates GraphQL fields from your SCL schema.

  • Namespace: app__ prefix (snake_case).
  • Tables: appplural (List), appsingular (By ID).
  • Mutations: insert..., update..., delete_....

Example: App com.acme.crm (comacmecrm), Table user (users).

  • Query List: comacmecrm__users
  • Query Single: comacmecrm__user

2. Reading Data (Query)

Basic List

query ListUsers {
  users: com_acme_crm__users(
    limit: 10
    offset: 0
    order_by: { created_at: desc }
  ) {
    id
    email
    # Nested relationship
    orders {
      id
      total
    }
  }
}

Filtering (where)

Operator Logic Example
eq, neq Equals / Not Equals { status: { _eq: "active" } }
gt, lt Greater / Less Than { count: { _gt: 5 } }
in, nin In List { id: { _in: ["A", "B"] } }
isnull Is Null { notes: { isnull: true } }
and, or Logic Groups { _or: [ { a: ... }, { b: ... } ] }

Aggregations (Stats)

Fetch counts, sums, averages.

  • agg Suffix: Use tablename_agg.
  • aggregate: Holds the stats.
  • nodes: Holds the actual records (optional).
query UserStats {
  com_acme_crm__users_agg(where: { status: { _eq: "active" } }) {
    aggregate {
      count
      sum { lifetime_value }
      avg { age }
    }
  }
}

3. Modifying Data (Mutation)

Insert

mutation NewUser($data: JSON!) {
  # returns the created object
  insert_com_acme_crm__user(object: $data) {
    id
  }
}

Update (Patch)

mutation MakeActive($id: ID!) {
  update_com_acme_crm__user(
    id: $id
    _set: { status: "active", updated_at: "now()" }
  ) {
    id
    status
  }
}

Delete

mutation RemoveUser($id: ID!) {
  delete_com_acme_crm__user(id: $id) {
    id
  }
}

4. Advanced Querying (Aggregation + Nodes)

Mixed Pagination

Get the TOTAL count of matches (aggregate) but only fetch the FIRST PAGE of actual data (nodes).

query SearchAndPaginate {
  com_acme_crm__users_agg(
    where: { status: { _eq: "active" } }
    order_by: { created_at: desc }
    limit: 20  # Applies to 'nodes'
    offset: 0  # Applies to 'nodes'
  ) {
    # 1. Total count matching the filter (ignoring limit!)
    aggregate {
      count
    }
    # 2. The actual page of data (respected limit)
    nodes {
      id
      email
    }
  }
}

Nested Aggregation

Calculate stats for related records (e.g., Average Order Value per User).

query UserStats {
  users: com_acme_crm__users {
    email
    # Aggregate on relationship
    orders_agg {
      aggregate {
        count
        sum { total }
      }
    }
  }
}

5. Introspection

When in doubt, query the schema itself to discover available types and fields.

query Introspection {
  __schema {
    types { name kind }
  }
}