@salesforce/webapp-template-feature-react-nav-menu-experimental 1.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/LICENSE.txt +82 -0
  2. package/dist/.a4drules/build-validation.md +81 -0
  3. package/dist/.a4drules/code-quality.md +150 -0
  4. package/dist/.a4drules/graphql/tools/knowledge/lds-explore-graphql-schema.md +227 -0
  5. package/dist/.a4drules/graphql/tools/knowledge/lds-generate-graphql-mutationquery.md +211 -0
  6. package/dist/.a4drules/graphql/tools/knowledge/lds-generate-graphql-readquery.md +185 -0
  7. package/dist/.a4drules/graphql/tools/knowledge/lds-guide-graphql.md +205 -0
  8. package/dist/.a4drules/graphql/tools/schemas/shared.graphqls +1150 -0
  9. package/dist/.a4drules/graphql.md +98 -0
  10. package/dist/.a4drules/images.md +13 -0
  11. package/dist/.a4drules/react.md +361 -0
  12. package/dist/.a4drules/react_image_processing.md +45 -0
  13. package/dist/.a4drules/typescript.md +224 -0
  14. package/dist/.forceignore +15 -0
  15. package/dist/.husky/pre-commit +4 -0
  16. package/dist/.prettierignore +11 -0
  17. package/dist/.prettierrc +17 -0
  18. package/dist/CHANGELOG.md +19 -0
  19. package/dist/README.md +18 -0
  20. package/dist/config/project-scratch-def.json +13 -0
  21. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/.prettierignore +9 -0
  22. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/.prettierrc +11 -0
  23. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/eslint.config.js +113 -0
  24. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/feature-react-nav-menu.webapplication-meta.xml +7 -0
  25. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/index.html +13 -0
  26. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/package.json +42 -0
  27. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/api/graphql-operations-types.ts +127 -0
  28. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/api/utils/query/highRevenueAccountsQuery.graphql +29 -0
  29. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/app.tsx +13 -0
  30. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/appLayout.tsx +11 -0
  31. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/assets/icons/book.svg +3 -0
  32. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/assets/icons/copy.svg +4 -0
  33. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/assets/icons/rocket.svg +3 -0
  34. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/assets/icons/star.svg +3 -0
  35. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/assets/images/codey-1.png +0 -0
  36. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/assets/images/codey-2.png +0 -0
  37. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/assets/images/codey-3.png +0 -0
  38. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/assets/images/vibe-codey.svg +194 -0
  39. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/navigationMenu.tsx +81 -0
  40. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/pages/About.tsx +12 -0
  41. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/pages/Home.tsx +12 -0
  42. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/pages/NotFound.tsx +18 -0
  43. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/pages/about.tsx +10 -0
  44. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/pages/new.tsx +10 -0
  45. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/router-utils.tsx +34 -0
  46. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/routes.tsx +39 -0
  47. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/src/styles/global.css +13 -0
  48. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/tsconfig.json +36 -0
  49. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/tsconfig.node.json +13 -0
  50. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/vite-env.d.ts +1 -0
  51. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/vite.config.ts +82 -0
  52. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/vitest-env.d.ts +2 -0
  53. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/vitest.config.ts +11 -0
  54. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/vitest.setup.ts +1 -0
  55. package/dist/force-app/main/default/webapplications/feature-react-nav-menu/webapplication.json +7 -0
  56. package/dist/jest.config.js +6 -0
  57. package/dist/package.json +37 -0
  58. package/dist/scripts/apex/hello.apex +10 -0
  59. package/dist/scripts/soql/account.soql +6 -0
  60. package/dist/sfdx-project.json +12 -0
  61. package/package.json +28 -0
package/LICENSE.txt ADDED
@@ -0,0 +1,82 @@
1
+ Terms of Use
2
+
3
+ Copyright 2026 Salesforce, Inc. All rights reserved.
4
+
5
+ These Terms of Use govern the download, installation, and/or use of this
6
+ software provided by Salesforce, Inc. ("Salesforce") (the "Software"), were
7
+ last updated on April 15, 2025, and constitute a legally binding
8
+ agreement between you and Salesforce. If you do not agree to these Terms of
9
+ Use, do not install or use the Software.
10
+
11
+ Salesforce grants you a worldwide, non-exclusive, no-charge, royalty-free
12
+ copyright license to reproduce, prepare derivative works of, publicly
13
+ display, publicly perform, sublicense, and distribute the Software and
14
+ derivative works subject to these Terms. These Terms shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ Subject to the limited rights expressly granted hereunder, Salesforce
18
+ reserves all rights, title, and interest in and to all intellectual
19
+ property subsisting in the Software. No rights are granted to you hereunder
20
+ other than as expressly set forth herein. Users residing in countries on
21
+ the United States Office of Foreign Assets Control sanction list, or which
22
+ are otherwise subject to a US export embargo, may not use the Software.
23
+
24
+ Implementation of the Software may require development work, for which you
25
+ are responsible. The Software may contain bugs, errors and
26
+ incompatibilities and is made available on an AS IS basis without support,
27
+ updates, or service level commitments.
28
+
29
+ Salesforce reserves the right at any time to modify, suspend, or
30
+ discontinue, the Software (or any part thereof) with or without notice. You
31
+ agree that Salesforce shall not be liable to you or to any third party for
32
+ any modification, suspension, or discontinuance.
33
+
34
+ You agree to defend Salesforce against any claim, demand, suit or
35
+ proceeding made or brought against Salesforce by a third party arising out
36
+ of or accruing from (a) your use of the Software, and (b) any application
37
+ you develop with the Software that infringes any copyright, trademark,
38
+ trade secret, trade dress, patent, or other intellectual property right of
39
+ any person or defames any person or violates their rights of publicity or
40
+ privacy (each a "Claim Against Salesforce"), and will indemnify Salesforce
41
+ from any damages, attorney fees, and costs finally awarded against
42
+ Salesforce as a result of, or for any amounts paid by Salesforce under a
43
+ settlement approved by you in writing of, a Claim Against Salesforce,
44
+ provided Salesforce (x) promptly gives you written notice of the Claim
45
+ Against Salesforce, (y) gives you sole control of the defense and
46
+ settlement of the Claim Against Salesforce (except that you may not settle
47
+ any Claim Against Salesforce unless it unconditionally releases Salesforce
48
+ of all liability), and (z) gives you all reasonable assistance, at your
49
+ expense.
50
+
51
+ WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE SOFTWARE IS NOT
52
+ SUPPORTED AND IS PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
53
+ IMPLIED. IN NO EVENT SHALL SALESFORCE HAVE ANY LIABILITY FOR ANY DAMAGES,
54
+ INCLUDING, BUT NOT LIMITED TO, DIRECT, INDIRECT, SPECIAL, INCIDENTAL,
55
+ PUNITIVE, OR CONSEQUENTIAL DAMAGES, OR DAMAGES BASED ON LOST PROFITS, DATA,
56
+ OR USE, IN CONNECTION WITH THE SOFTWARE, HOWEVER CAUSED AND WHETHER IN
57
+ CONTRACT, TORT, OR UNDER ANY OTHER THEORY OF LIABILITY, WHETHER OR NOT YOU
58
+ HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
59
+
60
+ These Terms of Use shall be governed exclusively by the internal laws of
61
+ the State of California, without regard to its conflicts of laws
62
+ rules. Each party hereby consents to the exclusive jurisdiction of the
63
+ state and federal courts located in San Francisco County, California to
64
+ adjudicate any dispute arising out of or relating to these Terms of Use and
65
+ the download, installation, and/or use of the Software. Except as expressly
66
+ stated herein, these Terms of Use constitute the entire agreement between
67
+ the parties, and supersede all prior and contemporaneous agreements,
68
+ proposals, or representations, written or oral, concerning their subject
69
+ matter. No modification, amendment, or waiver of any provision of these
70
+ Terms of Use shall be effective unless it is by an update to these Terms of
71
+ Use that Salesforce makes available, or is in writing and signed by the
72
+ party against whom the modification, amendment, or waiver is to be
73
+ asserted.
74
+
75
+ Data Privacy: Salesforce may collect, process, and store device,
76
+ system, and other information related to your use of the Software. This
77
+ information includes, but is not limited to, IP address, user metrics, and
78
+ other data ("Usage Data"). Salesforce may use Usage Data for analytics,
79
+ product development, and marketing purposes. You acknowledge that files
80
+ generated in conjunction with the Software may contain sensitive or
81
+ confidential data, and you are solely responsible for anonymizing and
82
+ protecting such data.
@@ -0,0 +1,81 @@
1
+ # AI Rule: Build Validation
2
+
3
+ Build validation for successful deployments with minimal friction.
4
+
5
+ ## Targets
6
+ - `force-app/main/default/webapplications/*/**/*`
7
+ - `**/*.{js,ts,jsx,tsx}`
8
+
9
+ ## MANDATORY: Build Success
10
+
11
+ **Before completing any coding session:**
12
+ ```bash
13
+ npm run build # MUST succeed with no errors
14
+ ```
15
+
16
+ ## Quick Quality Checks
17
+ ```bash
18
+ npm run format:check # Auto-fixable
19
+ npm run lint # Most issues auto-fixable
20
+ tsc -b # Catches major issues
21
+ ```
22
+
23
+ ## Requirements
24
+
25
+ **Must Pass:**
26
+ - `npm run build` completes successfully
27
+ - No TypeScript compilation errors
28
+ - No critical ESLint errors
29
+
30
+ **Can Be Warnings:**
31
+ - ESLint warnings
32
+ - Prettier formatting issues
33
+ - Minor TypeScript warnings
34
+
35
+ ## Auto-Fix Commands
36
+ ```bash
37
+ npm run fix-all # Fix formatting + linting
38
+ npm run format # Fix Prettier issues
39
+ npm run lint:fix # Fix ESLint issues
40
+ ```
41
+
42
+ ## Workflow
43
+
44
+ **During Development:**
45
+ 1. Write code with AI assistance
46
+ 2. Save frequently (auto-format on save)
47
+ 3. Check periodically: `npm run lint` (optional)
48
+
49
+ **Before Completion:**
50
+ 1. Run `npm run build`
51
+ 2. If fails: Run `npm run fix-all`, fix TypeScript errors, retry build
52
+
53
+ ## Error Priority
54
+
55
+ **Fix Immediately:**
56
+ - TypeScript compilation errors
57
+ - Import/export errors
58
+ - Syntax errors
59
+
60
+ **Fix When Convenient:**
61
+ - ESLint warnings
62
+ - Prettier formatting
63
+ - Unused variables
64
+
65
+ ## Hard Requirements
66
+ - Build must complete without errors
67
+ - No broken imports
68
+ - Basic TypeScript type safety
69
+
70
+ ## Key Commands
71
+ ```bash
72
+ npm run dev # Start development
73
+ npm run build # Check deployment readiness
74
+ npm run fix-all # Fix common issues
75
+ ```
76
+
77
+ ## Troubleshooting Import Errors
78
+ ```bash
79
+ npm install # Check missing dependencies
80
+ # Verify file exists, case sensitivity, export/import match
81
+ ```
@@ -0,0 +1,150 @@
1
+ # AI Rule: Code Quality Standards
2
+
3
+ Enforces ESLint, Prettier, and coding best practices for consistent, maintainable code.
4
+
5
+ ## Targets
6
+ - `force-app/main/default/webapplications/*/**/*`
7
+ - `**/*.{js,ts,jsx,tsx,json,md}`
8
+
9
+ ## MANDATORY Checks
10
+
11
+ **Before writing code:**
12
+ ```bash
13
+ npm run lint # MUST result in: 0 problems (0 errors, 0 warnings)
14
+ npm run format:check # MUST result in: All matched files use Prettier code style!
15
+ ```
16
+
17
+ ## Prettier Config (.prettierrc)
18
+ ```json
19
+ {
20
+ "semi": true,
21
+ "trailingComma": "es5",
22
+ "singleQuote": true,
23
+ "printWidth": 80,
24
+ "tabWidth": 2,
25
+ "useTabs": false,
26
+ "bracketSpacing": true,
27
+ "arrowParens": "avoid",
28
+ "endOfLine": "lf"
29
+ }
30
+ ```
31
+
32
+ ## Auto-Fix Commands
33
+ ```bash
34
+ npm run fix-all # Fix formatting + linting (recommended)
35
+ npm run format # Fix Prettier issues
36
+ npm run lint:fix # Fix ESLint issues
37
+ ```
38
+
39
+ ## Import Order (MANDATORY)
40
+ ```typescript
41
+ // 1. React ecosystem
42
+ import { useState, useEffect } from 'react';
43
+
44
+ // 2. External libraries (alphabetical)
45
+ import axios from 'axios';
46
+ import clsx from 'clsx';
47
+
48
+ // 3. UI components (alphabetical)
49
+ import { Button } from '@/components/ui/button';
50
+ import { Card } from '@/components/ui/card';
51
+
52
+ // 4. Internal utilities (alphabetical)
53
+ import { useAuth } from '../hooks/useAuth';
54
+ import { formatDate } from '../utils/dateUtils';
55
+
56
+ // 5. Relative imports
57
+ import { ComponentA } from './ComponentA';
58
+
59
+ // 6. Type imports (separate, at end)
60
+ import type { User, ApiResponse } from '../types';
61
+ ```
62
+
63
+ ## Naming Conventions
64
+ ```typescript
65
+ // PascalCase: Components, classes
66
+ const UserProfile = () => {};
67
+ const ApiClient = class {};
68
+
69
+ // camelCase: Variables, functions, properties
70
+ const userName = 'john';
71
+ const fetchUserData = async () => {};
72
+
73
+ // SCREAMING_SNAKE_CASE: Constants
74
+ const API_BASE_URL = 'https://api.example.com';
75
+
76
+ // kebab-case: Files
77
+ // user-profile.tsx, api-client.ts
78
+ ```
79
+
80
+ ## React Component Structure
81
+ ```typescript
82
+ interface ComponentProps {
83
+ // Props interface first
84
+ }
85
+
86
+ const Component: React.FC<ComponentProps> = ({ prop1, prop2 }) => {
87
+ // 1. Hooks
88
+ // 2. Computed values
89
+ // 3. Event handlers
90
+ // 4. JSX return
91
+
92
+ return <div />;
93
+ };
94
+
95
+ export default Component;
96
+ ```
97
+
98
+ ## JSX Standards
99
+ ```typescript
100
+ // Self-closing tags
101
+ <Button onClick={handleClick} />
102
+
103
+ // Conditional rendering
104
+ {isLoading && <Spinner />}
105
+ {error ? <ErrorMessage error={error} /> : <Content />}
106
+
107
+ // Lists with keys
108
+ {items.map(item => <Item key={item.id} data={item} />)}
109
+ ```
110
+
111
+ ## Error Handling
112
+ ```typescript
113
+ // Async functions with try-catch
114
+ const fetchData = async (id: string): Promise<Data> => {
115
+ try {
116
+ const response = await api.get(`/data/${id}`);
117
+ return response.data;
118
+ } catch (error) {
119
+ console.error('Failed to fetch data:', error);
120
+ throw error;
121
+ }
122
+ };
123
+ ```
124
+
125
+ ## Anti-Patterns (FORBIDDEN)
126
+ ```typescript
127
+ // NEVER disable ESLint without justification
128
+ // eslint-disable-next-line
129
+
130
+ // NEVER mutate state directly
131
+ state.items.push(newItem); // Wrong
132
+ setItems(prev => [...prev, newItem]); // Correct
133
+
134
+ // NEVER use magic numbers/strings
135
+ setTimeout(() => {}, 5000); // Wrong
136
+ const DEBOUNCE_DELAY = 5000; // Correct
137
+ ```
138
+
139
+ ## Quality Workflow
140
+
141
+ **Before Committing:**
142
+ 1. `npm run check-all` - All checks must pass
143
+ 2. `npm run fix-all` - Auto-fix issues if needed
144
+ 3. `npm run build` - Build must succeed
145
+
146
+ ## Zero Tolerance Policy
147
+ - ESLint errors: MUST be 0
148
+ - ESLint warnings: MUST be 0
149
+ - Prettier violations: MUST be 0
150
+ - TypeScript errors: MUST be 0
@@ -0,0 +1,227 @@
1
+ # GraphQL Schema Reference
2
+
3
+ This document provides guidance for AI agents working with the Salesforce GraphQL API schema in this project.
4
+
5
+ ## Schema File Location
6
+
7
+ **The complete GraphQL schema is located at: `@schema.graphql`** (in the project root)
8
+
9
+ > ⚠️ **Important**: The schema file is very large (~265,000+ lines). Do NOT read it entirely. Instead, use targeted searches to find specific types, fields, or operations.
10
+
11
+ If the file is not present, generate it by running:
12
+ ```bash
13
+ npm run graphql:get-schema
14
+ ```
15
+
16
+ ## Required Pre-Flight Check
17
+
18
+ **BEFORE generating any GraphQL query, you MUST:**
19
+
20
+ 1. **Check if schema exists**: Look for `schema.graphql` in the project root
21
+ 2. **If schema is missing**:
22
+ - Run `npm run graphql:get-schema` to download it
23
+ - Wait for the command to complete successfully
24
+ - Then proceed with schema exploration
25
+ 3. **If schema exists**: Proceed with targeted searches as described below
26
+
27
+ > ⚠️ **DO NOT** generate GraphQL queries without first having access to the schema. Standard field assumptions may not match the target org's configuration.
28
+
29
+ ## Schema Structure Overview
30
+
31
+ The schema follows the Salesforce GraphQL Wire Adapter pattern with these main entry points:
32
+
33
+ ### Query Entry Point
34
+ ```graphql
35
+ type Query {
36
+ uiapi: UIAPI!
37
+ }
38
+ ```
39
+
40
+ ### UIAPI Structure
41
+ ```graphql
42
+ type UIAPI {
43
+ query: RecordQuery! # For querying records
44
+ aggregate: RecordQueryAggregate! # For aggregate queries
45
+ objectInfos: [ObjectInfo] # For metadata
46
+ relatedListByName: RelatedListInfo
47
+ }
48
+ ```
49
+
50
+ ### Mutation Entry Point
51
+ ```graphql
52
+ type Mutation {
53
+ uiapi(input: UIAPIMutationsInput): UIAPIMutations!
54
+ }
55
+ ```
56
+
57
+ ## How to Explore the Schema
58
+
59
+ When you need to build a GraphQL query, use these search patterns:
60
+
61
+ ### 1. Find Available Fields for a Record Type
62
+ Search for `type <ObjectName> implements Record` to find all queryable fields:
63
+ ```bash
64
+ # Example: Find Account fields
65
+ grep "^type Account implements Record" schema.graphql -A 50
66
+ ```
67
+
68
+ ### 2. Find Filter Options for a Record Type
69
+ Search for `input <ObjectName>_Filter` to find filterable fields and operators:
70
+ ```bash
71
+ # Example: Find Account filter options
72
+ grep "^input Account_Filter" schema.graphql -A 30
73
+ ```
74
+
75
+ ### 3. Find OrderBy Options
76
+ Search for `input <ObjectName>_OrderBy` for sorting options:
77
+ ```bash
78
+ # Example: Find Account ordering options
79
+ grep "^input Account_OrderBy" schema.graphql -A 20
80
+ ```
81
+
82
+ ### 4. Find Mutation Operations
83
+ Search for operations in `UIAPIMutations`:
84
+ ```bash
85
+ # Example: Find Account mutations
86
+ grep "Account.*Create\|Account.*Update\|Account.*Delete" schema.graphql
87
+ ```
88
+
89
+ ### 5. Find Input Types for Mutations
90
+ Search for `input <ObjectName>CreateInput` or `input <ObjectName>UpdateInput`:
91
+ ```bash
92
+ # Example: Find Account create input
93
+ grep "^input AccountCreateInput" schema.graphql -A 30
94
+ ```
95
+
96
+ ## Common Operator Types
97
+
98
+ ### StringOperators (for text fields)
99
+ ```graphql
100
+ input StringOperators {
101
+ eq: String # equals
102
+ ne: String # not equals
103
+ like: String # pattern matching (use % as wildcard)
104
+ lt: String # less than
105
+ gt: String # greater than
106
+ lte: String # less than or equal
107
+ gte: String # greater than or equal
108
+ in: [String] # in list
109
+ nin: [String] # not in list
110
+ }
111
+ ```
112
+
113
+ ### OrderByClause
114
+ ```graphql
115
+ input OrderByClause {
116
+ order: ResultOrder # ASC or DESC
117
+ nulls: NullOrder # FIRST or LAST
118
+ }
119
+ ```
120
+
121
+ ## Query Pattern Examples
122
+
123
+ ### Basic Query Structure
124
+ All record queries follow this pattern:
125
+ ```graphql
126
+ query {
127
+ uiapi {
128
+ query {
129
+ <ObjectName>(
130
+ first: Int # pagination limit
131
+ after: String # pagination cursor
132
+ where: <Object>_Filter
133
+ orderBy: <Object>_OrderBy
134
+ ) {
135
+ edges {
136
+ node {
137
+ Id
138
+ <Field> { value }
139
+ # ... more fields
140
+ }
141
+ }
142
+ }
143
+ }
144
+ }
145
+ }
146
+ ```
147
+
148
+ ### Example: Query Accounts with Filter
149
+ ```graphql
150
+ query GetHighRevenueAccounts($minRevenue: Currency) {
151
+ uiapi {
152
+ query {
153
+ Account(
154
+ where: { AnnualRevenue: { gt: $minRevenue } }
155
+ orderBy: { AnnualRevenue: { order: DESC } }
156
+ first: 50
157
+ ) {
158
+ edges {
159
+ node {
160
+ Id
161
+ Name { value }
162
+ AnnualRevenue { value }
163
+ Industry { value }
164
+ }
165
+ }
166
+ }
167
+ }
168
+ }
169
+ }
170
+ ```
171
+
172
+ ### Mutation Pattern
173
+ ```graphql
174
+ mutation CreateAccount($input: AccountCreateInput!) {
175
+ uiapi(input: { AccountCreate: { input: $input } }) {
176
+ AccountCreate {
177
+ Record {
178
+ Id
179
+ Name { value }
180
+ }
181
+ }
182
+ }
183
+ }
184
+ ```
185
+
186
+ ## Field Value Wrappers
187
+
188
+ Salesforce GraphQL returns field values wrapped in typed objects:
189
+
190
+ | Wrapper Type | Access Pattern |
191
+ |-------------|----------------|
192
+ | `StringValue` | `FieldName { value }` |
193
+ | `IntValue` | `FieldName { value }` |
194
+ | `BooleanValue` | `FieldName { value }` |
195
+ | `DateTimeValue` | `FieldName { value displayValue }` |
196
+ | `PicklistValue` | `FieldName { value displayValue }` |
197
+ | `CurrencyValue` | `FieldName { value displayValue }` |
198
+
199
+ ## Agent Workflow for Building Queries
200
+
201
+ **Pre-requisites (MANDATORY):**
202
+ - [ ] Verified `schema.graphql` exists in project root
203
+ - [ ] If missing, ran `npm run graphql:get-schema` and waited for completion
204
+ - [ ] Confirmed connection to correct Salesforce org (if downloading fresh schema)
205
+
206
+ **Workflow Steps:**
207
+
208
+ 1. **Identify the target object** (e.g., Account, Contact, Opportunity)
209
+ 2. **Search the schema** for the object type to discover available fields
210
+ 3. **Search for filter input** (`<Object>_Filter`) to understand filtering options
211
+ 4. **Search for orderBy input** (`<Object>_OrderBy`) for sorting capabilities
212
+ 5. **Build the query** following the patterns above
213
+ 6. **Validate field names** match exactly as defined in the schema (case-sensitive)
214
+
215
+ ## Tips for Agents
216
+
217
+ - **Always verify field names** by searching the schema before generating queries
218
+ - **Use grep/search** to explore the schema efficiently—never read the entire file
219
+ - **Check relationships** by looking for `parentRelationship` and `childRelationship` comments in type definitions
220
+ - **Look for Connection types** (e.g., `AccountConnection`) to understand pagination structure
221
+ - **Custom objects** end with `__c` (e.g., `CustomObject__c`)
222
+ - **Custom fields** also end with `__c` (e.g., `Custom_Field__c`)
223
+
224
+ ## Related Documentation
225
+
226
+ - For generating mutations and queries, see `lds-generate-graphql-mutationquery.md`
227
+ - For GraphQL best practices, see `lds-guide-graphql.md`