using-ui-bundle-salesforce-data

Implements Salesforce record queries and mutations in UI bundles via the Data SDK and GraphQL.

1|Updated May 7, 2026
One-click install
npx skills add https://github.com/amanpraaj/sf-skill-hub --skill using-ui-bundle-salesforce-data-amanpraaj
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: using-ui-bundle-salesforce-data
Source: https://github.com/amanpraaj/sf-skill-hub/tree/main/skills/salesforce/using-ui-bundle-salesforce-data
Command: npx skills add https://github.com/amanpraaj/sf-skill-hub --skill using-ui-bundle-salesforce-data-amanpraaj

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires @salesforce/sdk-data, and includes scripts (resource) components.

What problem does it solve? Building React UI bundles that read, create, update, or delete Salesforce records is error-prone because Salesforce GraphQL has platform-specific behaviors (HTTP 200 with errors, FLS failures, silent pagination defaults) that cause silent runtime failures. This Skill enforces the correct Data SDK patterns, schema-verified queries, and mutation syntax so generated code works against the real org schema. ## Core Features & Use Cases - Schema-Verified GraphQL Generation: Uses the graphql-search.sh script to confirm entity names, fields, filters, and mutation representations from schema.graphql before writing any query. - Query & Mutation Templates: Provides read queries with @optional directives, pagination, filtering, ordering, semi/anti-joins, and create/update/delete mutations with allOrNone and @{alias} chaining. - REST Fallback Patterns: Covers the allowlisted REST endpoints (UI API, Apex REST, Connect REST, Einstein LLM) via sdk.fetch when GraphQL is insufficient. - Use Case: When a user asks to build a form in a UI bundle that creates an Account and a related Contact, the Skill verifies the schema, generates a chained mutation with type codegen, and validates with ESLint. ## Quick Start Ask the agent to build a UI bundle page that queries Salesforce Accounts and displays them, and it will verify the schema, generate the GraphQL query with types, and wire up the Data SDK call.

Frequently Asked Questions about using-ui-bundle-salesforce-data

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I query Salesforce records with GraphQL in a UI bundle?▼

Use the Data SDK's sdk.graphql method with a query under the uiapi namespace, after verifying entity and field names with the graphql-search.sh script. Always include first: for pagination, apply @optional to record fields, and generate TypeScript types with npm run graphql:codegen.

How do I create or update Salesforce records with GraphQL mutations?▼

Wrap mutations in uiapi(input: { allOrNone: true }) and use entity-specific inputs like AccountCreateInput. Updates must include the record Id, and related records can be chained with @{alias} references to earlier mutation Ids.

When should I use GraphQL versus REST for Salesforce data access?▼

GraphQL is preferred for all record queries and mutations. Use sdk.fetch REST only for cases GraphQL does not cover: UI API record metadata, Apex REST custom logic, Connect REST file upload config, and Einstein LLM generations.

Why does my Salesforce GraphQL query fail even though the field name looks correct?▼

Salesforce field names are case-sensitive and custom objects use __c suffixes, while some v60+ objects use a _Record suffix. Run graphql-search.sh against schema.graphql to confirm the exact type and field names before writing the query.

Why does my Salesforce GraphQL request return HTTP 200 but no data?▼

Salesforce returns HTTP 200 even when operations fail, with details in the response body's errors array. Always parse response.errors and use optional chaining when consuming data, since @optional fields may be omitted due to field-level security.

Can I use SOQL or the Enterprise REST query endpoint from a UI bundle?▼

No, the /services/data/v*/query SOQL endpoint is blocked at the proxy level. Use GraphQL for record reads, or Apex REST if server-side SOQL aggregates are required.