@salesforce/lds-runtime-mobile 1.131.0-dev12 → 1.131.0-dev13
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.
- package/dist/main.js +22 -12
- package/package.json +15 -15
- package/sfdc/main.js +22 -12
package/dist/main.js
CHANGED
|
@@ -9187,26 +9187,20 @@ function generateRecordQueries(objectInfos) {
|
|
|
9187
9187
|
let recordConnections = ``;
|
|
9188
9188
|
const polymorphicFieldTypeNames = new Set();
|
|
9189
9189
|
let typedScalars = new Set();
|
|
9190
|
+
let parentRelationshipFields = new Set();
|
|
9190
9191
|
for (const objectInfo of values(objectInfos)) {
|
|
9191
9192
|
const { apiName, childRelationships } = objectInfo;
|
|
9192
9193
|
let fields = ``;
|
|
9193
9194
|
typedScalars.add(`${apiName}_Filter`);
|
|
9194
9195
|
typedScalars.add(`${apiName}_OrderBy`);
|
|
9195
|
-
for (const childRelationship of childRelationships) {
|
|
9196
|
-
const { childObjectApiName } = childRelationship;
|
|
9197
|
-
// Only add the relationship if there is relevant objectinfos for it,
|
|
9198
|
-
// otherwise we'd be defining types we cannot satisfy and aren't referenced in
|
|
9199
|
-
// the query.
|
|
9200
|
-
if (objectInfos[childObjectApiName] !== undefined) {
|
|
9201
|
-
fields += `${childRelationship.relationshipName}(first: Int, where: ${childObjectApiName}_Filter, orderBy: ${childObjectApiName}_OrderBy, scope: SupportedScopes): ${childObjectApiName}Connection \n`;
|
|
9202
|
-
typedScalars.add(`${childObjectApiName}_Filter`);
|
|
9203
|
-
typedScalars.add(`${childObjectApiName}_OrderBy`);
|
|
9204
|
-
}
|
|
9205
|
-
}
|
|
9206
9196
|
for (const field of values(objectInfo.fields)) {
|
|
9207
9197
|
if (!fieldsStaticallyAdded.includes(field.apiName)) {
|
|
9208
9198
|
fields += `${field.apiName}: ${dataTypeToType(field.dataType, field.apiName)}\n`;
|
|
9209
9199
|
}
|
|
9200
|
+
//handles parent relationship
|
|
9201
|
+
if (field.relationshipName === null) {
|
|
9202
|
+
continue;
|
|
9203
|
+
}
|
|
9210
9204
|
// For spanning parent relationships with no union types
|
|
9211
9205
|
if (field.referenceToInfos.length === 1) {
|
|
9212
9206
|
const [relation] = field.referenceToInfos;
|
|
@@ -9214,11 +9208,13 @@ function generateRecordQueries(objectInfos) {
|
|
|
9214
9208
|
// otherwise we'd be defining types we cannot satisfy and aren't referenced in
|
|
9215
9209
|
// the query.
|
|
9216
9210
|
if (objectInfos[relation.apiName] !== undefined) {
|
|
9211
|
+
parentRelationshipFields.add(field.relationshipName);
|
|
9217
9212
|
fields += `${field.relationshipName}: ${relation.apiName}\n`;
|
|
9218
9213
|
}
|
|
9219
9214
|
// For polymorphic field, its type is 'Record' inteface. The concrete entity type name is saved for field resolving of next phase
|
|
9220
9215
|
}
|
|
9221
9216
|
else if (field.referenceToInfos.length > 1) {
|
|
9217
|
+
parentRelationshipFields.add(field.relationshipName);
|
|
9222
9218
|
fields += `${field.relationshipName}: Record\n`;
|
|
9223
9219
|
for (const relation of field.referenceToInfos) {
|
|
9224
9220
|
if (objectInfos[relation.apiName] !== undefined) {
|
|
@@ -9227,6 +9223,20 @@ function generateRecordQueries(objectInfos) {
|
|
|
9227
9223
|
}
|
|
9228
9224
|
}
|
|
9229
9225
|
}
|
|
9226
|
+
// handles child relationship
|
|
9227
|
+
for (const childRelationship of childRelationships) {
|
|
9228
|
+
const { childObjectApiName } = childRelationship;
|
|
9229
|
+
// Only add the relationship if there is relevant objectinfos for it,
|
|
9230
|
+
// otherwise we'd be defining types we cannot satisfy and aren't referenced in
|
|
9231
|
+
// the query.
|
|
9232
|
+
// If one field has both parent relationship and child relationship with the same name, the child relationship is ignored. This is how the server GQL has implemented as date of 08/07/2023
|
|
9233
|
+
if (objectInfos[childObjectApiName] !== undefined &&
|
|
9234
|
+
!parentRelationshipFields.has(childRelationship.relationshipName)) {
|
|
9235
|
+
fields += `${childRelationship.relationshipName}(first: Int, where: ${childObjectApiName}_Filter, orderBy: ${childObjectApiName}_OrderBy, scope: SupportedScopes): ${childObjectApiName}Connection \n`;
|
|
9236
|
+
typedScalars.add(`${childObjectApiName}_Filter`);
|
|
9237
|
+
typedScalars.add(`${childObjectApiName}_OrderBy`);
|
|
9238
|
+
}
|
|
9239
|
+
}
|
|
9230
9240
|
recordQueries += `${apiName}(first: Int, where: ${apiName}_Filter, orderBy: ${apiName}_OrderBy, scope: SupportedScopes): ${apiName}Connection\n`;
|
|
9231
9241
|
const isServiceAppointment = apiName === 'ServiceAppointment';
|
|
9232
9242
|
recordConnections += /* GraphQL */ `
|
|
@@ -16200,4 +16210,4 @@ register({
|
|
|
16200
16210
|
});
|
|
16201
16211
|
|
|
16202
16212
|
export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
16203
|
-
// version: 1.131.0-
|
|
16213
|
+
// version: 1.131.0-dev13-329f91e5c
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lds-runtime-mobile",
|
|
3
|
-
"version": "1.131.0-
|
|
3
|
+
"version": "1.131.0-dev13",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"description": "LDS runtime for mobile/hybrid environments.",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -32,24 +32,24 @@
|
|
|
32
32
|
"release:corejar": "yarn build && ../core-build/scripts/core.js --name=lds-runtime-mobile"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@salesforce/lds-adapters-uiapi": "1.131.0-
|
|
36
|
-
"@salesforce/lds-bindings": "1.131.0-
|
|
37
|
-
"@salesforce/lds-instrumentation": "1.131.0-
|
|
38
|
-
"@salesforce/lds-priming": "1.131.0-
|
|
35
|
+
"@salesforce/lds-adapters-uiapi": "1.131.0-dev13",
|
|
36
|
+
"@salesforce/lds-bindings": "1.131.0-dev13",
|
|
37
|
+
"@salesforce/lds-instrumentation": "1.131.0-dev13",
|
|
38
|
+
"@salesforce/lds-priming": "1.131.0-dev13",
|
|
39
39
|
"@salesforce/user": "0.0.12",
|
|
40
40
|
"o11y": "244.0.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@salesforce/lds-adapters-graphql": "1.131.0-
|
|
44
|
-
"@salesforce/lds-drafts": "1.131.0-
|
|
45
|
-
"@salesforce/lds-drafts-adapters-uiapi": "1.131.0-
|
|
46
|
-
"@salesforce/lds-graphql-eval": "1.131.0-
|
|
47
|
-
"@salesforce/lds-network-adapter": "1.131.0-
|
|
48
|
-
"@salesforce/lds-network-nimbus": "1.131.0-
|
|
49
|
-
"@salesforce/lds-store-binary": "1.131.0-
|
|
50
|
-
"@salesforce/lds-store-sql": "1.131.0-
|
|
51
|
-
"@salesforce/lds-utils-adapters": "1.131.0-
|
|
52
|
-
"@salesforce/nimbus-plugin-lds": "1.131.0-
|
|
43
|
+
"@salesforce/lds-adapters-graphql": "1.131.0-dev13",
|
|
44
|
+
"@salesforce/lds-drafts": "1.131.0-dev13",
|
|
45
|
+
"@salesforce/lds-drafts-adapters-uiapi": "1.131.0-dev13",
|
|
46
|
+
"@salesforce/lds-graphql-eval": "1.131.0-dev13",
|
|
47
|
+
"@salesforce/lds-network-adapter": "1.131.0-dev13",
|
|
48
|
+
"@salesforce/lds-network-nimbus": "1.131.0-dev13",
|
|
49
|
+
"@salesforce/lds-store-binary": "1.131.0-dev13",
|
|
50
|
+
"@salesforce/lds-store-sql": "1.131.0-dev13",
|
|
51
|
+
"@salesforce/lds-utils-adapters": "1.131.0-dev13",
|
|
52
|
+
"@salesforce/nimbus-plugin-lds": "1.131.0-dev13",
|
|
53
53
|
"babel-plugin-dynamic-import-node": "^2.3.3",
|
|
54
54
|
"wait-for-expect": "^3.0.2"
|
|
55
55
|
},
|
package/sfdc/main.js
CHANGED
|
@@ -9187,26 +9187,20 @@ function generateRecordQueries(objectInfos) {
|
|
|
9187
9187
|
let recordConnections = ``;
|
|
9188
9188
|
const polymorphicFieldTypeNames = new Set();
|
|
9189
9189
|
let typedScalars = new Set();
|
|
9190
|
+
let parentRelationshipFields = new Set();
|
|
9190
9191
|
for (const objectInfo of values(objectInfos)) {
|
|
9191
9192
|
const { apiName, childRelationships } = objectInfo;
|
|
9192
9193
|
let fields = ``;
|
|
9193
9194
|
typedScalars.add(`${apiName}_Filter`);
|
|
9194
9195
|
typedScalars.add(`${apiName}_OrderBy`);
|
|
9195
|
-
for (const childRelationship of childRelationships) {
|
|
9196
|
-
const { childObjectApiName } = childRelationship;
|
|
9197
|
-
// Only add the relationship if there is relevant objectinfos for it,
|
|
9198
|
-
// otherwise we'd be defining types we cannot satisfy and aren't referenced in
|
|
9199
|
-
// the query.
|
|
9200
|
-
if (objectInfos[childObjectApiName] !== undefined) {
|
|
9201
|
-
fields += `${childRelationship.relationshipName}(first: Int, where: ${childObjectApiName}_Filter, orderBy: ${childObjectApiName}_OrderBy, scope: SupportedScopes): ${childObjectApiName}Connection \n`;
|
|
9202
|
-
typedScalars.add(`${childObjectApiName}_Filter`);
|
|
9203
|
-
typedScalars.add(`${childObjectApiName}_OrderBy`);
|
|
9204
|
-
}
|
|
9205
|
-
}
|
|
9206
9196
|
for (const field of values(objectInfo.fields)) {
|
|
9207
9197
|
if (!fieldsStaticallyAdded.includes(field.apiName)) {
|
|
9208
9198
|
fields += `${field.apiName}: ${dataTypeToType(field.dataType, field.apiName)}\n`;
|
|
9209
9199
|
}
|
|
9200
|
+
//handles parent relationship
|
|
9201
|
+
if (field.relationshipName === null) {
|
|
9202
|
+
continue;
|
|
9203
|
+
}
|
|
9210
9204
|
// For spanning parent relationships with no union types
|
|
9211
9205
|
if (field.referenceToInfos.length === 1) {
|
|
9212
9206
|
const [relation] = field.referenceToInfos;
|
|
@@ -9214,11 +9208,13 @@ function generateRecordQueries(objectInfos) {
|
|
|
9214
9208
|
// otherwise we'd be defining types we cannot satisfy and aren't referenced in
|
|
9215
9209
|
// the query.
|
|
9216
9210
|
if (objectInfos[relation.apiName] !== undefined) {
|
|
9211
|
+
parentRelationshipFields.add(field.relationshipName);
|
|
9217
9212
|
fields += `${field.relationshipName}: ${relation.apiName}\n`;
|
|
9218
9213
|
}
|
|
9219
9214
|
// For polymorphic field, its type is 'Record' inteface. The concrete entity type name is saved for field resolving of next phase
|
|
9220
9215
|
}
|
|
9221
9216
|
else if (field.referenceToInfos.length > 1) {
|
|
9217
|
+
parentRelationshipFields.add(field.relationshipName);
|
|
9222
9218
|
fields += `${field.relationshipName}: Record\n`;
|
|
9223
9219
|
for (const relation of field.referenceToInfos) {
|
|
9224
9220
|
if (objectInfos[relation.apiName] !== undefined) {
|
|
@@ -9227,6 +9223,20 @@ function generateRecordQueries(objectInfos) {
|
|
|
9227
9223
|
}
|
|
9228
9224
|
}
|
|
9229
9225
|
}
|
|
9226
|
+
// handles child relationship
|
|
9227
|
+
for (const childRelationship of childRelationships) {
|
|
9228
|
+
const { childObjectApiName } = childRelationship;
|
|
9229
|
+
// Only add the relationship if there is relevant objectinfos for it,
|
|
9230
|
+
// otherwise we'd be defining types we cannot satisfy and aren't referenced in
|
|
9231
|
+
// the query.
|
|
9232
|
+
// If one field has both parent relationship and child relationship with the same name, the child relationship is ignored. This is how the server GQL has implemented as date of 08/07/2023
|
|
9233
|
+
if (objectInfos[childObjectApiName] !== undefined &&
|
|
9234
|
+
!parentRelationshipFields.has(childRelationship.relationshipName)) {
|
|
9235
|
+
fields += `${childRelationship.relationshipName}(first: Int, where: ${childObjectApiName}_Filter, orderBy: ${childObjectApiName}_OrderBy, scope: SupportedScopes): ${childObjectApiName}Connection \n`;
|
|
9236
|
+
typedScalars.add(`${childObjectApiName}_Filter`);
|
|
9237
|
+
typedScalars.add(`${childObjectApiName}_OrderBy`);
|
|
9238
|
+
}
|
|
9239
|
+
}
|
|
9230
9240
|
recordQueries += `${apiName}(first: Int, where: ${apiName}_Filter, orderBy: ${apiName}_OrderBy, scope: SupportedScopes): ${apiName}Connection\n`;
|
|
9231
9241
|
const isServiceAppointment = apiName === 'ServiceAppointment';
|
|
9232
9242
|
recordConnections += /* GraphQL */ `
|
|
@@ -16200,4 +16210,4 @@ register({
|
|
|
16200
16210
|
});
|
|
16201
16211
|
|
|
16202
16212
|
export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
16203
|
-
// version: 1.131.0-
|
|
16213
|
+
// version: 1.131.0-dev13-329f91e5c
|