afv-library/skills/using-ui-bundle-salesforce-data/scripts/graphql-search.sh

192 lines
6.1 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
set -euo pipefail # exit on error (-e), undefined vars (-u), and propagate pipeline failures (-o pipefail)
# graphql-search.sh — Look up one or more Salesforce entities in schema.graphql.
#
# Run from the SFDX project root (where schema.graphql lives):
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
# bash scripts/graphql-search.sh Account
# bash scripts/graphql-search.sh Account Contact Opportunity
#
# Pass a custom schema path with -s / --schema:
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
# bash scripts/graphql-search.sh -s /path/to/schema.graphql Account
# bash scripts/graphql-search.sh --schema ./other/schema.graphql Account Contact
#
# Output sections per entity:
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
# 1. Type definition — all fields and relationships
# 2. Filter options — <Entity>_Filter input (for `where:`)
# 3. Sort options — <Entity>_OrderBy input (for `orderBy:`)
# 4. Create mutation wrapper — <Entity>CreateInput
# 5. Create mutation fields — <Entity>CreateRepresentation (for create mutations)
# 6. Update mutation wrapper — <Entity>UpdateInput
# 7. Update mutation fields — <Entity>UpdateRepresentation (for update mutations)
SCHEMA="./schema.graphql"
# ── Argument parsing ─────────────────────────────────────────────────────────
while [[ $# -gt 0 ]]; do
case "$1" in
-s|--schema)
if [[ -z "${2-}" || "$2" == -* ]]; then
echo "ERROR: --schema requires a file path argument"
exit 1
fi
SCHEMA="$2"
shift 2
;;
--)
shift
break
;;
-*)
echo "ERROR: Unknown option: $1"
echo "Usage: bash $0 [-s <schema-path>] <EntityName> [EntityName2 ...]"
exit 1
;;
*)
break
;;
esac
done
if [ $# -eq 0 ]; then
echo "Usage: bash $0 [-s <schema-path>] <EntityName> [EntityName2 ...]"
echo "Example: bash $0 Account"
echo "Example: bash $0 Account Contact Opportunity"
echo "Example: bash $0 --schema /path/to/schema.graphql Account"
exit 1
fi
if [ ! -f "$SCHEMA" ]; then
echo "ERROR: schema.graphql not found at $SCHEMA"
echo " Make sure you are running from the SFDX project root, or pass the path explicitly:"
echo " bash $0 --schema <path/to/schema.graphql> <EntityName>"
echo " If the file is missing entirely, generate it from the UI bundle dir:"
echo " cd force-app/main/default/uiBundles/<app-name> && npm run graphql:schema"
exit 1
fi
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
if [ ! -r "$SCHEMA" ]; then
echo "ERROR: schema.graphql is not readable at $SCHEMA"
echo " Check file permissions: ls -la $SCHEMA"
exit 1
fi
if [ ! -s "$SCHEMA" ]; then
echo "ERROR: schema.graphql is empty at $SCHEMA"
echo " Regenerate it from the UI bundle dir:"
echo " cd force-app/main/default/uiBundles/<app-name> && npm run graphql:schema"
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
exit 1
fi
# ── Helper: extract lines from a grep match through the closing brace ────────
# Prints up to MAX_LINES lines after (and including) the first match of PATTERN.
# Uses a generous line count — blocks are always closed by a "}" line.
extract_block() {
local label="$1"
local pattern="$2"
local max_lines="$3"
local match
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
local grep_exit=0
match=$(grep -nE "$pattern" "$SCHEMA" | head -1) || grep_exit=$?
if [ "$grep_exit" -eq 2 ]; then
echo " ERROR: grep failed on pattern: $pattern" >&2
return 1
fi
if [ -z "$match" ]; then
echo " (not found: $pattern)"
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
return 3
fi
echo "### $label"
grep -E "$pattern" "$SCHEMA" -A "$max_lines" | \
awk '/^\}$/{print; exit} {print}' | \
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
head -n "$max_lines" || true
echo ""
}
# ── Main loop ────────────────────────────────────────────────────────────────
for ENTITY in "$@"; do
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
# Validate entity name: must be a valid PascalCase identifier (letters, digits, underscores)
if [[ ! "$ENTITY" =~ ^[A-Za-z_][A-Za-z0-9_]*$ ]]; then
echo "ERROR: Invalid entity name: '$ENTITY'"
echo " Entity names must start with a letter or underscore, followed by letters, digits, or underscores."
echo " Examples: Account, My_Custom_Object__c"
continue
fi
echo ""
echo "======================================================================"
echo " SCHEMA LOOKUP: $ENTITY"
echo "======================================================================"
echo ""
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
found=0
# Helper: call extract_block, track matches, surface errors
try_extract() {
local rc=0
extract_block "$@" || rc=$?
if [ "$rc" -eq 0 ]; then
found=$((found + 1))
elif [ "$rc" -eq 1 ]; then
echo " Aborting lookup for '$ENTITY' due to grep error" >&2
fi
# rc=3 is not-found — continue silently (already printed by extract_block)
}
# 1. Type definition — all fields and relationships
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
try_extract \
"Type definition — fields and relationships" \
"^type ${ENTITY} implements Record" \
200
# 2. Filter input — used in `where:` arguments
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
try_extract \
"Filter options — use in where: { ... }" \
"^input ${ENTITY}_Filter" \
100
# 3. OrderBy input — used in `orderBy:` arguments
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
try_extract \
"Sort options — use in orderBy: { ... }" \
"^input ${ENTITY}_OrderBy" \
60
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
# 4. Create mutation wrapper
try_extract \
"Create mutation wrapper — ${ENTITY}CreateInput" \
"^input ${ENTITY}CreateInput" \
10
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
# 5. Create mutation fields
try_extract \
"Create mutation fields — ${ENTITY}CreateRepresentation" \
"^input ${ENTITY}CreateRepresentation" \
100
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
# 6. Update mutation wrapper
try_extract \
"Update mutation wrapper — ${ENTITY}UpdateInput" \
"^input ${ENTITY}UpdateInput" \
10
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
# 7. Update mutation fields
try_extract \
"Update mutation fields — ${ENTITY}UpdateRepresentation" \
"^input ${ENTITY}UpdateRepresentation" \
100
W-21685788: Expand using-webapp-salesforce-data guidance (#101) * feat(using-webapp-salesforce-data): add supporting documentation Add detailed reference docs for schema introspection, read query generation, mutation query generation, query testing, and webapp integration patterns. Made-with: Cursor * refactor(using-webapp-salesforce-data): move graphql-search.sh to scripts/ Relocate the schema search script from the skill root into a dedicated scripts/ directory for better organization. Made-with: Cursor * feat(using-webapp-salesforce-data): align SKILL.md with using-salesforce-data - Add GraphQL Non-Negotiable Rules section (6 critical platform rules) - Fix mutation template to include allOrNone wrapper - Add doc cross-references (schema introspection, query generation, testing, webapp integration) - Add deploying-webapp-to-salesforce skill cross-reference - Update script paths from .a4drules/... to scripts/graphql-search.sh - Expand checklist with allOrNone, pagination, and error handling items - Add two named webapp integration patterns (external .graphql, inline gql) Made-with: Cursor * fix: remove negative constraints from frontmatter and body * fix: pr feedback * refactor(using-webapp-salesforce-data): rename docs to references Made-with: Cursor * Revert "fix: remove negative constraints from frontmatter and body" This reverts commit f439b7ad31a92bb03bb61ecdb86d4e1eaff5daae. * fix: update graphql schema search script * fix: update skill name for deploying to salesforce --------- Co-authored-by: Hemant Singh Bisht <hsinghbisht@salesforce.com>
2026-03-30 17:22:05 +08:00
if [ "$found" -eq 0 ]; then
echo "WARNING: No schema entries found for '$ENTITY'."
echo " - Names are PascalCase (e.g., 'Account' not 'account')"
echo " - Custom objects may need deployment first"
fi
echo ""
done