From 04b850b0e35245e2e81cff30480c9f9c7bd2dba4 Mon Sep 17 00:00:00 2001 From: Jose David Rodriguez Velasco Date: Wed, 1 Apr 2026 17:42:48 -0400 Subject: [PATCH] fix: delete testing with sf cli --- .../using-ui-bundle-salesforce-data/SKILL.md | 29 ++++--------------- 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/skills/using-ui-bundle-salesforce-data/SKILL.md b/skills/using-ui-bundle-salesforce-data/SKILL.md index c815efb..57cfec5 100644 --- a/skills/using-ui-bundle-salesforce-data/SKILL.md +++ b/skills/using-ui-bundle-salesforce-data/SKILL.md @@ -439,27 +439,9 @@ type AccountNode = NodeOfConnection` from UI bundle dir -2. **Test**: Ask user before testing. For mutations, request input values — never fabricate data. +2. **codegen**: `npm run graphql:codegen` from UI bundle dir -#### Testing with sf CLI - -```bash -sf api request rest /services/data/v66.0/graphql \ - --method POST \ - --body '{"query":"","variables":{...}}' -``` - -Run from SFDX project root. Use v66.0+ for mutations, v65.0+ for `@optional`. - -#### Result Status - -| Status | Condition | Meaning | -|--------|-----------|---------| -| `SUCCESS` | `errors` absent or empty | Query is valid | -| `FAILED` | `data` is empty/null | Query is invalid — fix and retry | -| `PARTIAL` | `data` present AND `errors` not empty | Some fields inaccessible (mutations) | - -**On FAILED**: Parse `errors[].extensions.ErrorType`, categorize, and fix: +#### Common Error patterns | Error Contains | Resolution | |----------------|------------| @@ -473,9 +455,7 @@ Run from SFDX project root. Use v66.0+ for mutations, v65.0+ for `@optional`. | `is not currently available in mutation results` | Remove field from mutation output | | `Cannot invoke JsonElement.isJsonObject()` | Use API version 64+ for update mutation `Record` selection | -**On PARTIAL** (mutations): Report inaccessible fields, explain they cannot be in mutation output, offer to remove them. **Wait for user consent** before changing. - -**Maximum 2 test attempts** per query. If still failing, restart from Step 1 (Acquire Schema). +**On PARTIAL** If a mutation returns both data and errors (partial success): Report inaccessible fields, explain they cannot be in mutation output, offer to remove them. **Wait for user consent** before changing. --- @@ -592,6 +572,7 @@ const response = await sdk.graphql?.(GET_CURRENT_USER); / ← SFDX project root ├── schema.graphql ← grep target (lives here) ├── sfdx-project.json +├── scripts/graphql-search.sh ← schema lookup script └── force-app/main/default/uiBundles// ← UI bundle dir ├── package.json ← npm scripts └── src/ @@ -600,9 +581,9 @@ const response = await sdk.graphql?.(GET_CURRENT_USER); | Command | Run From | Why | |---------|----------|-----| | `npm run graphql:schema` | UI bundle dir | Script in UI bundle's package.json | +| `npm run graphql:codegen` | UI bundle dir | Generate GraphQL types | | `npx eslint ` | UI bundle dir | Reads eslint.config.js | | `bash scripts/graphql-search.sh ` | project root | Schema lookup | -| `sf api request rest` | project root | Needs sfdx-project.json | ---