experience-ui-bundle-salesforce-data-access

Implements Salesforce record reads, writes, and caching in UI bundles via the platform-sdk GraphQL API.

Updated Jul 2, 2026
One-click install
npx skills add https://github.com/padjei/SF_Build --skill experience-ui-bundle-salesforce-data-access-padjei
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: experience-ui-bundle-salesforce-data-access
Source: https://github.com/padjei/SF_Build/tree/main/.claude/skills/experience-ui-bundle-salesforce-data-access
Command: npx skills add https://github.com/padjei/SF_Build --skill experience-ui-bundle-salesforce-data-access-padjei

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Wiring Salesforce data access into a UI bundle is error-prone: unverified field names silently fail entire queries at runtime, FLS-gated fields break reads, the old @salesforce/sdk-data callable API is dead, and developers often rebuild caching that the SDK already provides. This Skill enforces the correct @salesforce/platform-sdk workflow so queries and mutations work the first time. ## Core Features & Use Cases - Guided Read/Write Workflows: Step-by-step flows for sdk.graphql.query and sdk.graphql.mutate, including schema verification, @optional FLS guardrails, pagination, and error handling. - Graphiti CLI Query Compilation: Compile JSON specs into schema-correct, guardrail-applied GraphQL documents with sf-gql-* commands, with a shell-script schema-grep fallback. - Caching & Freshness Control: Explains the default 300-second WebApp cache, per-call cacheControl policies, and the reactive subscribe/refresh handle for post-mutation updates. - Migration Path: Converts legacy @salesforce/sdk-data callable code to the new namespace API with a before/after checklist. - Use Case: A developer building a UI bundle needs to list Accounts with a refresh button. The Skill routes them through schema discovery, query compilation, codegen, and a cacheControl: no-cache refresh export. ## Quick Start Ask the agent to add a data layer to your UI bundle that queries Account records with Name and Industry fields using the Salesforce platform SDK.

Frequently Asked Questions about experience-ui-bundle-salesforce-data-access

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

FAQPage Schema
How do I query Salesforce records from a UI bundle?▼

Create the SDK with createDataSDK() from @salesforce/platform-sdk, then call sdk.graphql.query with a gql-tagged operation and variables. Verify every entity and field against the schema first, apply @optional to FLS-gated fields, and always check result.errors before reading result.data.

How do I create or update Salesforce records with the platform SDK?▼

Use sdk.graphql.mutate with the operation under the mutation key, wrapping variables in an entity-keyed input like { input: { Account: { Name: "Acme" } } }. Updates add a sibling Id; deletes pass only Id. Mutations are never cached, so call result.refresh() on a held query to update lists.

Does sdk.graphql.query cache results automatically?▼

Yes, on the WebApp surface every query is cached by default with a 300-second max-age TTL, shared across SDK instances by baseUrl. Override per call with cacheControl options like no-cache, only-if-cached, or a custom max-age in seconds.

Why does my Salesforce GraphQL query fail at runtime?▼

The most common cause is an unverified entity or field name, which fails the entire query silently. Verify names with graphiti sf-gql-discover or the graphql-search.sh script, and never edit schema.graphql to force a match since it grants no org access.

Can I use sdk.graphql! on every surface?▼

No, the non-null assertion is only safe on WebApp where sdk.graphql is always present. On Mosaic, OpenAI, or MCPApps surfaces it can be undefined, so guard with if (!sdk.graphql) before calling to avoid a runtime crash.

How do I migrate from the old @salesforce/sdk-data callable API?▼

Replace the import with @salesforce/platform-sdk and convert sdk.graphql?.(query, vars) calls to sdk.graphql!.query({ query, variables }), using mutate({ mutation, variables }) for writes. The migration reference provides a full before/after diff and checklist.