@salesforce/lds-runtime-mobile 1.246.0 → 1.248.0
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 +396 -120
- package/package.json +1 -1
- package/sfdc/main.js +396 -120
package/dist/main.js
CHANGED
|
@@ -15,7 +15,7 @@ import { withRegistration, register } from '@salesforce/lds-default-luvio';
|
|
|
15
15
|
import { setupInstrumentation, instrumentAdapter as instrumentAdapter$1, instrumentLuvio, setLdsAdaptersUiapiInstrumentation, setLdsNetworkAdapterInstrumentation } from '@salesforce/lds-instrumentation';
|
|
16
16
|
import { HttpStatusCode, StoreKeySet, serializeStructuredKey, StringKeyInMemoryStore, Reader, deepFreeze, emitAdapterEvent, createCustomAdapterEventEmitter, StoreKeyMap, isFileReference, Environment, Luvio, InMemoryStore } from '@luvio/engine';
|
|
17
17
|
import excludeStaleRecordsGate from '@salesforce/gate/lds.graphqlEvalExcludeStaleRecords';
|
|
18
|
-
import { parseAndVisit, Kind, visit, execute,
|
|
18
|
+
import { parseAndVisit, Kind, buildSchema, isObjectType, defaultFieldResolver, visit, execute, parse as parse$7, extendSchema, isScalarType } from '@luvio/graphql-parser';
|
|
19
19
|
import { RECORD_ID_PREFIX, RECORD_FIELDS_KEY_JUNCTION, isStoreKeyRecordViewEntity, getRecordId18, RECORD_REPRESENTATION_NAME, extractRecordIdFromStoreKey, keyBuilderQuickActionExecutionRepresentation, ingestQuickActionExecutionRepresentation, keyBuilderContentDocumentCompositeRepresentation, getResponseCacheKeysContentDocumentCompositeRepresentation, keyBuilderFromTypeContentDocumentCompositeRepresentation, ingestContentDocumentCompositeRepresentation, keyBuilderRecord, RECORD_VIEW_ENTITY_ID_PREFIX, getTypeCacheKeysRecord, keyBuilderFromTypeRecordRepresentation, ingestRecord, RecordRepresentationRepresentationType, ObjectInfoRepresentationType, getRecordAdapterFactory, getObjectInfoAdapterFactory, getObjectInfosAdapterFactory, getObjectInfoDirectoryAdapterFactory, UiApiNamespace, RecordRepresentationType, RecordRepresentationTTL, RecordRepresentationVersion, keyBuilderObjectInfo, ObjectInfoDirectoryEntryRepresentationType, getRecordsAdapterFactory } from '@salesforce/lds-adapters-uiapi';
|
|
20
20
|
import caseSensitiveUserId from '@salesforce/user/Id';
|
|
21
21
|
import { idleDetector, getInstrumentation } from 'o11y/client';
|
|
@@ -5180,8 +5180,12 @@ function uuidv4() {
|
|
|
5180
5180
|
|
|
5181
5181
|
const HTTP_HEADER_RETRY_AFTER = 'Retry-After';
|
|
5182
5182
|
const HTTP_HEADER_IDEMPOTENCY_KEY = 'Idempotency-Key';
|
|
5183
|
+
const ERROR_CODE_IDEMPOTENCY_FEATURE_NOT_ENABLED = 'IDEMPOTENCY_FEATURE_NOT_ENABLED';
|
|
5184
|
+
const ERROR_CODE_IDEMPOTENCY_NOT_SUPPORTED = 'IDEMPOTENCY_NOT_SUPPORTED';
|
|
5183
5185
|
const ERROR_CODE_IDEMPOTENCY_KEY_USED_DIFFERENT_USER = 'IDEMPOTENCY_KEY_USED_DIFFERENT_USER';
|
|
5184
5186
|
const ERROR_CODE_IDEMPOTENCY_CONCURRENT_REQUEST = 'IDEMPOTENCY_CONCURRENT_REQUEST';
|
|
5187
|
+
const ERROR_CODE_IDEMPOTENCY_KEY_ALREADY_USED = 'IDEMPOTENCY_KEY_ALREADY_USED';
|
|
5188
|
+
const ERROR_CODE_IDEMPOTENCY_BACKEND_OPERATION_ERROR = 'IDEMPOTENCY_BACKEND_OPERATION_ERROR';
|
|
5185
5189
|
/**
|
|
5186
5190
|
* Get the retry after in milliseconds from the response headers, undefined if not specified.
|
|
5187
5191
|
* The header could have two different format.
|
|
@@ -5211,7 +5215,9 @@ function buildLuvioOverrideForDraftAdapters(luvio, handler, extractTargetIdFromC
|
|
|
5211
5215
|
const dispatchResourceRequest = async function (resourceRequest, _context) {
|
|
5212
5216
|
const resourceRequestCopy = clone$1(resourceRequest);
|
|
5213
5217
|
resourceRequestCopy.headers = resourceRequestCopy.headers || {};
|
|
5214
|
-
|
|
5218
|
+
if (handler.hasIdempotencySupport()) {
|
|
5219
|
+
resourceRequestCopy.headers[HTTP_HEADER_IDEMPOTENCY_KEY] = uuidv4();
|
|
5220
|
+
}
|
|
5215
5221
|
// enable return extra fields for record creation and record update http call
|
|
5216
5222
|
if (resourceRequest.basePath === '/ui-api/records' &&
|
|
5217
5223
|
(resourceRequest.method === 'post' || resourceRequest.method === 'patch')) {
|
|
@@ -6047,6 +6053,7 @@ class AbstractResourceRequestActionHandler {
|
|
|
6047
6053
|
// the luvio store redirect table, during which a new draft might be enqueued
|
|
6048
6054
|
// which would not see a necessary mapping.
|
|
6049
6055
|
this.ephemeralRedirects = {};
|
|
6056
|
+
this.isIdempotencySupported = true;
|
|
6050
6057
|
}
|
|
6051
6058
|
enqueue(data) {
|
|
6052
6059
|
return this.draftQueue.enqueue(this.handlerId, data);
|
|
@@ -6076,21 +6083,43 @@ class AbstractResourceRequestActionHandler {
|
|
|
6076
6083
|
retryDelayInMs = getRetryAfterInMs(response.headers);
|
|
6077
6084
|
shouldRetry = true;
|
|
6078
6085
|
break;
|
|
6079
|
-
case HttpStatusCode.ServerError:
|
|
6086
|
+
case HttpStatusCode.ServerError: {
|
|
6080
6087
|
shouldRetry = true;
|
|
6088
|
+
if (this.handleIdempotencyServerError(response.body, updatedAction, false, ERROR_CODE_IDEMPOTENCY_BACKEND_OPERATION_ERROR)) {
|
|
6089
|
+
this.isIdempotencySupported = false;
|
|
6090
|
+
retryDelayInMs = 0;
|
|
6091
|
+
actionDataChanged = true;
|
|
6092
|
+
}
|
|
6081
6093
|
break;
|
|
6094
|
+
}
|
|
6082
6095
|
case 409 /* IdempotentWriteSpecificHttpStatusCode.Conflict */: {
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6096
|
+
if (this.isUiApiErrors(response.body)) {
|
|
6097
|
+
const errorCode = response.body[0].errorCode;
|
|
6098
|
+
if (this.handleIdempotencyServerError(response.body, updatedAction, true, ERROR_CODE_IDEMPOTENCY_KEY_USED_DIFFERENT_USER)) {
|
|
6099
|
+
retryDelayInMs = 0;
|
|
6100
|
+
actionDataChanged = true;
|
|
6101
|
+
}
|
|
6102
|
+
else if (errorCode === ERROR_CODE_IDEMPOTENCY_CONCURRENT_REQUEST) {
|
|
6103
|
+
retryDelayInMs = getRetryAfterInMs(response.headers);
|
|
6104
|
+
}
|
|
6105
|
+
shouldRetry = true;
|
|
6106
|
+
}
|
|
6107
|
+
break;
|
|
6108
|
+
}
|
|
6109
|
+
case HttpStatusCode.BadRequest: {
|
|
6110
|
+
if (this.handleIdempotencyServerError(response.body, updatedAction, false, ERROR_CODE_IDEMPOTENCY_FEATURE_NOT_ENABLED, ERROR_CODE_IDEMPOTENCY_NOT_SUPPORTED)) {
|
|
6087
6111
|
retryDelayInMs = 0;
|
|
6088
6112
|
actionDataChanged = true;
|
|
6113
|
+
shouldRetry = true;
|
|
6089
6114
|
}
|
|
6090
|
-
|
|
6091
|
-
|
|
6115
|
+
break;
|
|
6116
|
+
}
|
|
6117
|
+
case 422 /* IdempotentWriteSpecificHttpStatusCode.UnProcessableEntity */: {
|
|
6118
|
+
if (this.handleIdempotencyServerError(response.body, updatedAction, true, ERROR_CODE_IDEMPOTENCY_KEY_ALREADY_USED)) {
|
|
6119
|
+
retryDelayInMs = 0;
|
|
6120
|
+
actionDataChanged = true;
|
|
6121
|
+
shouldRetry = true;
|
|
6092
6122
|
}
|
|
6093
|
-
shouldRetry = true;
|
|
6094
6123
|
break;
|
|
6095
6124
|
}
|
|
6096
6125
|
}
|
|
@@ -6109,6 +6138,27 @@ class AbstractResourceRequestActionHandler {
|
|
|
6109
6138
|
return ProcessActionResult.NETWORK_ERROR;
|
|
6110
6139
|
}
|
|
6111
6140
|
}
|
|
6141
|
+
// true if response is an idempotency server error. updates or deletes idempotency key if the reponse is idempotency related error. Idempotency related error is in format of UiApiError array.
|
|
6142
|
+
handleIdempotencyServerError(responseBody, action, updateIdempotencyKey, ...targetErrorCodes) {
|
|
6143
|
+
if (this.isUiApiErrors(responseBody)) {
|
|
6144
|
+
const errorCode = responseBody[0].errorCode;
|
|
6145
|
+
if (targetErrorCodes.includes(errorCode)) {
|
|
6146
|
+
action.data.headers = action.data.headers || {};
|
|
6147
|
+
if (updateIdempotencyKey) {
|
|
6148
|
+
action.data.headers[HTTP_HEADER_IDEMPOTENCY_KEY] = uuidv4();
|
|
6149
|
+
}
|
|
6150
|
+
else {
|
|
6151
|
+
delete action.data.headers[HTTP_HEADER_IDEMPOTENCY_KEY];
|
|
6152
|
+
}
|
|
6153
|
+
return true;
|
|
6154
|
+
}
|
|
6155
|
+
}
|
|
6156
|
+
return false;
|
|
6157
|
+
}
|
|
6158
|
+
// checks if the body is an array of UiApiError. Sometimes the body has `enhancedErrorType` field as an error indicator(one example is the field validation failure). In such case Action being processed updates to an Error Action.
|
|
6159
|
+
isUiApiErrors(body) {
|
|
6160
|
+
return body !== undefined && Array.isArray(body) && body.length > 0 && body[0].errorCode;
|
|
6161
|
+
}
|
|
6112
6162
|
async buildPendingAction(request, queue) {
|
|
6113
6163
|
const targetId = await this.getIdFromRequest(request);
|
|
6114
6164
|
const tag = this.buildTagForTargetId(targetId);
|
|
@@ -6319,6 +6369,10 @@ class AbstractResourceRequestActionHandler {
|
|
|
6319
6369
|
...targetData,
|
|
6320
6370
|
body: this.mergeRequestBody(targetBody, sourceBody),
|
|
6321
6371
|
};
|
|
6372
|
+
// Updates Idempotency key if target has one
|
|
6373
|
+
if (targetData.headers && targetData.headers[HTTP_HEADER_IDEMPOTENCY_KEY]) {
|
|
6374
|
+
merged.data.headers[HTTP_HEADER_IDEMPOTENCY_KEY] = uuidv4();
|
|
6375
|
+
}
|
|
6322
6376
|
// overlay metadata
|
|
6323
6377
|
merged.metadata = { ...targetMetadata, ...sourceMetadata };
|
|
6324
6378
|
// put status back to pending to auto upload if queue is active and targed is at the head.
|
|
@@ -6355,6 +6409,9 @@ class AbstractResourceRequestActionHandler {
|
|
|
6355
6409
|
getDraftIdsFromAction(action) {
|
|
6356
6410
|
return [action.targetId];
|
|
6357
6411
|
}
|
|
6412
|
+
hasIdempotencySupport() {
|
|
6413
|
+
return this.isIdempotencySupported;
|
|
6414
|
+
}
|
|
6358
6415
|
async ingestResponses(responses, action) {
|
|
6359
6416
|
const luvio = this.getLuvio();
|
|
6360
6417
|
await luvio.handleSuccessResponse(() => {
|
|
@@ -7020,7 +7077,7 @@ function isArrayLike(x) {
|
|
|
7020
7077
|
|
|
7021
7078
|
const { create: create$4, keys: keys$4, values: values$2, entries: entries$3, assign: assign$4 } = Object;
|
|
7022
7079
|
const { stringify: stringify$4, parse: parse$4 } = JSON;
|
|
7023
|
-
const { isArray: isArray$2 } = Array;
|
|
7080
|
+
const { isArray: isArray$2, from: from$1 } = Array;
|
|
7024
7081
|
|
|
7025
7082
|
function recordLoaderFactory(query) {
|
|
7026
7083
|
async function batchRecordQuery(ids) {
|
|
@@ -9241,7 +9298,7 @@ async function fetchIngestionTimeStampFromDatabase(apiName, info, args, query) {
|
|
|
9241
9298
|
return ingestionTimestamp;
|
|
9242
9299
|
}
|
|
9243
9300
|
|
|
9244
|
-
var uiapiSchemaString = "scalar String\nscalar DateTime\nscalar Currency\nscalar ID\nscalar Boolean\nscalar Longitude\nscalar Float\nscalar MultiPicklist\nscalar Base64\nscalar Url\nscalar PhoneNumber\nscalar Email\nscalar TextArea\nscalar Latitude\nscalar Picklist\nscalar RichTextArea\nscalar EncryptedString\nscalar Double\nscalar Long\nscalar JSON\nscalar Time\nscalar Int\nscalar Percent\nscalar LongTextArea\nscalar IdOrRef\nscalar Date\ntype PercentAggregate implements FieldValue {\n value: Percent\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n max: PercentValue\n min: PercentValue\n sum: PercentValue\n}\n\ntype StringAggregate implements FieldValue {\n value: String\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n label: String\n max: StringValue\n min: StringValue\n}\n\ntype Query {\n uiapi: UIAPI!\n rateLimit: RateLimit\n}\n\ninput EmailOperators {\n eq: Email\n ne: Email\n like: Email\n lt: Email\n gt: Email\n lte: Email\n gte: Email\n in: [Email]\n nin: [Email]\n}\n\ninput PolymorphicParentRelationshipRecordOrderBy @generic {\n RecordOrderBy: RecordOrderBy @fieldCategory\n}\n\ninput DoubleOperators {\n eq: Double\n ne: Double\n lt: Double\n gt: Double\n lte: Double\n gte: Double\n in: [Double]\n nin: [Double]\n}\n\ntype DateOnlyAggregation {\n value: Date\n format: String\n}\n\ntype RecordCreatePayload @generic {\n Record: RecordRepresentation\n}\n\ntype DateAggregate implements FieldValue {\n value: Date\n displayValue: String\n calendarMonth: DateFunctionAggregation\n calendarQuarter: DateFunctionAggregation\n calendarYear: DateFunctionAggregation\n count: LongValue\n countDistinct: LongValue\n dayInMonth: DateFunctionAggregation\n dayInWeek: DateFunctionAggregation\n dayInYear: DateFunctionAggregation\n fiscalMonth: DateFunctionAggregation\n fiscalQuarter: DateFunctionAggregation\n fiscalYear: DateFunctionAggregation\n format: String\n grouping: IntValue\n max: DateValue\n min: DateValue\n weekInMonth: DateFunctionAggregation\n weekInYear: DateFunctionAggregation\n}\n\ninput PolymorphicParentRelationshipGroupBy @generic {\n RecordGroupBy: RecordGroupBy @fieldCategory\n}\n\nenum GroupByFunction {\n DAY_IN_WEEK\n DAY_IN_MONTH\n DAY_IN_YEAR\n WEEK_IN_MONTH\n WEEK_IN_YEAR\n CALENDAR_MONTH\n CALENDAR_QUARTER\n CALENDAR_YEAR\n FISCAL_MONTH\n FISCAL_QUARTER\n FISCAL_YEAR\n DAY_ONLY\n HOUR_IN_DAY\n}\n\ntype RecordTypeInfo {\n available: Boolean!\n defaultRecordTypeMapping: Boolean!\n master: Boolean!\n name: String\n recordTypeId: ID\n}\n\ntype BooleanValue implements FieldValue {\n value: Boolean\n displayValue: String\n}\n\ntype ReferenceToInfo {\n ApiName: String!\n nameFields: [String]!\n objectInfo: ObjectInfo\n}\n\ninterface FieldValue {\n displayValue: String\n}\n\ntype LongitudeValue implements FieldValue {\n value: Longitude\n displayValue: String\n}\n\ntype StringValue implements FieldValue {\n value: String\n displayValue: String\n label: String\n}\n\ntype IntValue implements FieldValue {\n value: Int\n displayValue: String\n format: String\n}\n\ntype UrlValue implements FieldValue {\n value: Url\n displayValue: String\n}\n\ninput IdOperators {\n eq: ID\n ne: ID\n lt: ID\n gt: ID\n lte: ID\n gte: ID\n in: [ID]\n nin: [ID]\n inq: JoinInput\n ninq: JoinInput\n}\n\ntype LongAggregate implements FieldValue {\n value: Long\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n grouping: IntValue\n max: LongValue\n min: LongValue\n sum: LongValue\n}\n\ntype PhoneNumberAggregate implements FieldValue {\n value: PhoneNumber\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: PhoneNumberValue\n min: PhoneNumberValue\n}\n\ninput TimeOperators {\n eq: Time\n ne: Time\n lt: Time\n gt: Time\n lte: Time\n gte: Time\n in: [Time]\n nin: [Time]\n}\n\ntype PicklistValue implements FieldValue {\n value: Picklist\n displayValue: String\n label: String\n}\n\ntype CurrencyAggregate implements FieldValue {\n value: Currency\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n max: CurrencyValue\n min: CurrencyValue\n sum: CurrencyValue\n}\n\ntype RelatedListInfo {\n childApiName: String!\n relatedListName: String!\n label: String!\n displayColumns: [ListColumn!]!\n orderedByInfo: [ListOrder!]!\n parentApiName: String!\n fieldApiName: String!\n}\n\ninput StringOperators {\n eq: String\n ne: String\n like: String\n lt: String\n gt: String\n lte: String\n gte: String\n in: [String]\n nin: [String]\n}\n\ntype UIAPI {\n query: RecordQuery!\n aggregate: RecordQueryAggregate!\n objectInfos(apiNames: [String]): [ObjectInfo]\n relatedListByName(parentApiName: String!, relatedListName: String!): RelatedListInfo\n}\n\ninput MultiPicklistOperators {\n eq: MultiPicklist\n ne: MultiPicklist\n includes: [MultiPicklist]\n excludes: [MultiPicklist]\n}\n\ntype DateTimeAggregate implements FieldValue {\n value: DateTime\n displayValue: String\n calendarMonth: DateFunctionAggregation\n calendarQuarter: DateFunctionAggregation\n calendarYear: DateFunctionAggregation\n count: LongValue\n countDistinct: LongValue\n dayInMonth: DateFunctionAggregation\n dayInWeek: DateFunctionAggregation\n dayInYear: DateFunctionAggregation\n dayOnly: DateOnlyAggregation\n fiscalMonth: DateFunctionAggregation\n fiscalQuarter: DateFunctionAggregation\n fiscalYear: DateFunctionAggregation\n format: String\n hourInDay: DateFunctionAggregation\n max: DateTimeValue\n min: DateTimeValue\n weekInMonth: DateFunctionAggregation\n weekInYear: DateFunctionAggregation\n}\n\ninput BooleanOperators {\n eq: Boolean\n ne: Boolean\n}\n\ntype EmailAggregate implements FieldValue {\n value: Email\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: EmailValue\n min: EmailValue\n}\n\n#enum OrderByType {\n#}\n\ninput GroupByDateFunction {\n function: GroupByFunction\n}\n\ntype RichTextAreaValue implements FieldValue {\n value: RichTextArea\n displayValue: String\n}\n\ntype MultiPicklistValue implements FieldValue {\n value: MultiPicklist\n displayValue: String\n label: String\n}\n\ntype TimeAggregate implements FieldValue {\n value: Time\n displayValue: String\n format: String\n hourInDay: DateFunctionAggregation\n}\n\ntype __Type {\n kind: __TypeKind!\n name: String\n description: String\n fields(includeDeprecated: Boolean = false): [__Field!]\n interfaces: [__Type!]\n possibleTypes: [__Type!]\n enumValues(includeDeprecated: Boolean = false): [__EnumValue!]\n inputFields: [__InputValue!]\n ofType: __Type\n}\n\ntype ListColumn {\n fieldApiName: String!\n label: String!\n lookupId: String\n sortable: Boolean\n}\n\ntype LatitudeAggregate implements FieldValue {\n value: Latitude\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n max: LatitudeValue\n min: LatitudeValue\n sum: DoubleValue\n}\n\ninput CurrencyOperators {\n eq: Currency\n ne: Currency\n lt: Currency\n gt: Currency\n lte: Currency\n gte: Currency\n in: [Currency]\n nin: [Currency]\n}\n\ninput DistanceInput {\n latitude: Latitude!\n longitude: Longitude!\n}\n\nunion PolymorphicParentRelationship @generic = RecordRepresentation\n\nenum AggregateOrderByNumberFunction {\n AVG\n COUNT\n COUNT_DISTINCT\n MAX\n MIN\n SUM\n}\n\ntype LongTextAreaValue implements FieldValue {\n value: LongTextArea\n displayValue: String\n}\n\ntype LatitudeValue implements FieldValue {\n value: Latitude\n displayValue: String\n}\n\ninput OrderByClause {\n order: ResultOrder\n nulls: NullOrder\n}\n\ninput AggregateOrderBy @generic {\n orderableNumberField: AggregateOrderByNumberClause @fieldCategory\n orderableStringField: AggregateOrderByStringClause @fieldCategory\n orderableField: NoFunctionAggregateOrderByClause @fieldCategory\n orderableGeolocationField: OrderByGeolocationClause @fieldCategory\n orderableParentRelationship: AggregateOrderBy @fieldCategory\n orderablePolymorphicParentRelationship: PolymorphicParentRelationshipOrderBy @fieldCategory\n type: String = ORDER_BY\n}\n\ninput GroupByClause {\n group: Boolean\n}\n\ntype RecordAggregateConnection @generic {\n edges: [RecordAggregateEdge]\n pageInfo: PageInfo!\n totalCount: Int!\n}\n\ntype LongitudeAggregate implements FieldValue {\n value: Longitude\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n max: LongitudeValue\n min: LongitudeValue\n sum: DoubleValue\n}\n\ntype RecordEdge @generic {\n node: RecordRepresentation\n cursor: String!\n}\n\ntype DateValue implements FieldValue {\n value: Date\n displayValue: String\n format: String\n}\n\ninput URLOperators {\n eq: Url\n ne: Url\n like: Url\n lt: Url\n gt: Url\n lte: Url\n gte: Url\n in: [Url]\n nin: [Url]\n}\n\ninput LongOperators {\n eq: Long\n ne: Long\n lt: Long\n gt: Long\n lte: Long\n gte: Long\n in: [Long]\n nin: [Long]\n}\n\nenum DataType {\n STRING\n TEXTAREA\n PHONE\n EMAIL\n URL\n ENCRYPTEDSTRING\n BOOLEAN\n CURRENCY\n INT\n LONG\n DOUBLE\n PERCENT\n DATETIME\n TIME\n DATE\n REFERENCE\n PICKLIST\n MULTIPICKLIST\n ADDRESS\n LOCATION\n BASE64\n COMPLEXVALUE\n COMBOBOX\n JSON\n JUNCTIONIDLIST\n ANYTYPE\n}\n\nenum NullOrder {\n LAST\n FIRST\n}\n\ntype PhoneNumberValue implements FieldValue {\n value: PhoneNumber\n displayValue: String\n}\n\n# Cannot have empty enum\n# enum RecordScope @generic {\n# }\n\ntype DoubleAggregate implements FieldValue {\n value: Double\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n max: DoubleValue\n min: DoubleValue\n sum: DoubleValue\n}\n\ntype __Field {\n name: String!\n description: String\n args: [__InputValue!]!\n type: __Type!\n isDeprecated: Boolean!\n deprecationReason: String\n}\n\ninput DateOperators {\n eq: DateInput\n ne: DateInput\n lt: DateInput\n gt: DateInput\n lte: DateInput\n gte: DateInput\n in: [DateInput]\n nin: [DateInput]\n DAY_IN_WEEK: DateFunctionInput\n DAY_IN_MONTH: DateFunctionInput\n DAY_IN_YEAR: DateFunctionInput\n WEEK_IN_MONTH: DateFunctionInput\n WEEK_IN_YEAR: DateFunctionInput\n CALENDAR_MONTH: DateFunctionInput\n CALENDAR_QUARTER: DateFunctionInput\n CALENDAR_YEAR: DateFunctionInput\n FISCAL_MONTH: DateFunctionInput\n FISCAL_QUARTER: DateFunctionInput\n FISCAL_YEAR: DateFunctionInput\n}\n\ninput GeolocationInput {\n latitude: Latitude!\n longitude: Longitude!\n radius: Float!\n unit: Unit!\n}\n\ninput JoinInput {\n Record: RecordFilter @fieldCategory\n ApiName: String\n}\n\ninput TextAreaOperators {\n eq: TextArea\n ne: TextArea\n like: TextArea\n lt: TextArea\n gt: TextArea\n lte: TextArea\n gte: TextArea\n in: [TextArea]\n nin: [TextArea]\n}\n\ntype TextAreaValue implements FieldValue {\n value: TextArea\n displayValue: String\n}\n\ntype RecordUpdatePayload @generic {\n success: Boolean\n}\n\ninput PercentOperators {\n eq: Percent\n ne: Percent\n lt: Percent\n gt: Percent\n lte: Percent\n gte: Percent\n in: [Percent]\n nin: [Percent]\n}\n\ntype DoubleValue implements FieldValue {\n value: Double\n displayValue: String\n format: String\n}\n\ntype IDAggregate implements FieldValue {\n value: ID\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: IDValue\n min: IDValue\n}\n\ntype __InputValue {\n name: String!\n description: String\n type: __Type!\n defaultValue: String\n}\n\ntype RecordAggregateEdge @generic {\n node: RecordResult\n cursor: String!\n}\n\ntype __Directive {\n name: String\n description: String\n locations: [__DirectiveLocation!]\n args: [__InputValue!]!\n}\n\ninput RecordCreateInput @generic {\n record: RecordCreateRepresentation! @fieldCategory\n}\n\ntype ThemeInfo {\n color: String\n iconUrl: String\n}\n\ninput AggregateOrderByStringClause {\n function: AggregateOrderByStringFunction\n order: ResultsOrder\n nulls: NullsOrder\n}\n\ntype RecordDeletePayload {\n Id: ID\n}\n\ntype UrlAggregate implements FieldValue {\n value: Url\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: UrlValue\n min: UrlValue\n}\n\nenum DateLiteral {\n TODAY\n LAST_90_DAYS\n LAST_YEAR\n NEXT_YEAR\n TOMORROW\n NEXT_QUARTER\n LAST_WEEK\n NEXT_90_DAYS\n THIS_YEAR\n LAST_FISCAL_QUARTER\n LAST_QUARTER\n THIS_FISCAL_YEAR\n THIS_MONTH\n THIS_FISCAL_QUARTER\n THIS_QUARTER\n NEXT_FISCAL_QUARTER\n NEXT_FISCAL_YEAR\n LAST_FISCAL_YEAR\n NEXT_WEEK\n YESTERDAY\n THIS_WEEK\n NEXT_MONTH\n LAST_MONTH\n}\n\ntype __EnumValue {\n name: String!\n description: String\n isDeprecated: Boolean!\n deprecationReason: String\n}\n\ntype RecordRepresentation implements Record @generic{\n Id: ID!\n ApiName: String!\n WeakEtag: Long!\n DisplayValue: String\n LastModifiedById: IDValue\n LastModifiedDate: DateTimeValue\n SystemModstamp: DateTimeValue\n RecordTypeId(fallback: Boolean): IDValue\n IntValue: IntValue @fieldCategory\n StringValue: StringValue @fieldCategory\n BooleanValue: BooleanValue @fieldCategory\n IDValue: IDValue @fieldCategory\n DateTimeValue: DateTimeValue @fieldCategory\n TimeValue: TimeValue @fieldCategory\n DateValue: DateValue @fieldCategory\n TextAreaValue: TextAreaValue @fieldCategory\n LongTextAreaValue: LongTextAreaValue @fieldCategory\n RichTextAreaValue: RichTextAreaValue @fieldCategory\n PhoneNumberValue: PhoneNumberValue @fieldCategory\n EmailValue: EmailValue @fieldCategory\n UrlValue: UrlValue @fieldCategory\n EncryptedStringValue: EncryptedStringValue @fieldCategory\n CurrencyValue: CurrencyValue @fieldCategory\n LongitudeValue: LongitudeValue @fieldCategory\n LatitudeValue: LatitudeValue @fieldCategory\n PicklistValue: PicklistValue @fieldCategory\n MultiPicklistValue: MultiPicklistValue @fieldCategory\n LongValue: LongValue @fieldCategory\n DoubleValue: DoubleValue @fieldCategory\n PercentValue: PercentValue @fieldCategory\n Base64Value: Base64Value @fieldCategory\n JSONValue: JSONValue @fieldCategory\n parentRelationship: RecordRepresentation @fieldCategory\n polymorphicParentRelationship: PolymorphicParentRelationship @fieldCategory\n childRelationship(first: Int, after: String, where: RecordFilter, orderBy: RecordOrderBy, upperBound: Int): RecordConnection @fieldCategory\n CompoundField: CompoundField @fieldCategory\n}\n\ntype IDValue implements FieldValue {\n value: ID\n displayValue: String\n}\n\nenum Unit {\n MI\n KM\n}\n\ninput PolymorphicParentRelationshipOrderBy @generic {\n AggregateOrderBy: AggregateOrderBy @fieldCategory\n}\n\ninput OrderByGeolocationClause {\n distance: DistanceInput\n order: ResultOrder\n nulls: NullOrder\n}\n\nenum NullsOrder {\n FIRST\n LAST\n}\n\ntype TextAreaAggregate implements FieldValue {\n value: TextArea\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: TextAreaValue\n min: TextAreaValue\n}\n\nenum GroupByType {\n GROUP_BY\n ROLLUP\n CUBE\n}\n\nenum ResultOrder {\n ASC\n DESC\n}\n\ninput RecordOrderBy @generic {\n orderableField: OrderByClause @fieldCategory\n orderableGeolocationField: OrderByGeolocationClause @fieldCategory\n orderableParentRelationship: RecordOrderBy @fieldCategory\n orderablePolymorphicParentRelationship: PolymorphicParentRelationshipRecordOrderBy @fieldCategory\n}\n\ninput PicklistOperators {\n eq: Picklist\n ne: Picklist\n in: [Picklist]\n nin: [Picklist]\n like: Picklist\n lt: Picklist\n gt: Picklist\n lte: Picklist\n gte: Picklist\n}\n\nenum ResultsOrder {\n ASC\n DESC\n}\n\ninput RecordFilter @generic {\n and: [RecordFilter]\n or: [RecordFilter]\n not: RecordFilter\n parentRelationshipRecordFilter: RecordFilter @fieldCategory\n polymorphicParentRelationshipRecordFilter: PolymorphicParentRelationshipRecordFilter @fieldCategory\n IntegerOperator: IntegerOperators @fieldCategory\n LongOperator: LongOperators @fieldCategory\n StringOperator: StringOperators @fieldCategory\n DoubleOperator: DoubleOperators @fieldCategory\n PercentOperator: PercentOperators @fieldCategory\n LongitudeOperator: LongitudeOperators @fieldCategory\n LatitudeOperator: LatitudeOperators @fieldCategory\n EmailOperator: EmailOperators @fieldCategory\n TextAreaOperator: TextAreaOperators @fieldCategory\n LongTextAreaOperator: LongTextAreaOperators @fieldCategory\n URLOperator: URLOperators @fieldCategory\n PhoneNumberOperator: PhoneNumberOperators @fieldCategory\n BooleanOperator: BooleanOperators @fieldCategory\n IdOperator: IdOperators @fieldCategory\n CurrencyOperator: CurrencyOperators @fieldCategory\n TimeOperator: TimeOperators @fieldCategory\n DateOperator: DateOperators @fieldCategory\n DateTimeOperator: DateTimeOperators @fieldCategory\n PicklistOperator: PicklistOperators @fieldCategory\n MultiPicklistOperator: MultiPicklistOperators @fieldCategory\n GeolocationOperator: GeolocationOperators @fieldCategory\n}\n\ntype TimeValue implements FieldValue {\n value: Time\n displayValue: String\n format: String\n}\n\ninput GeolocationOperators {\n lt: GeolocationInput\n gt: GeolocationInput\n}\n\ntype PicklistAggregate implements FieldValue {\n value: Picklist\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n label: String\n max: PicklistValue\n min: PicklistValue\n}\n\ninput LatitudeOperators {\n eq: Latitude\n ne: Latitude\n lt: Latitude\n gt: Latitude\n lte: Latitude\n gte: Latitude\n in: [Latitude]\n nin: [Latitude]\n}\n\ninput RecordUpdateRepresentation @generic {\n Int: Int @fieldCategory\n String: String @fieldCategory\n Boolean: Boolean @fieldCategory\n ID: IdOrRef @fieldCategory\n DateTime: DateTime @fieldCategory\n Time: Time @fieldCategory\n Date: Date @fieldCategory\n TextArea: TextArea @fieldCategory\n LongTextArea: LongTextArea @fieldCategory\n RichTextArea: RichTextArea @fieldCategory\n PhoneNumber: PhoneNumber @fieldCategory\n Email: Email @fieldCategory\n Url: Url @fieldCategory\n EncryptedString: EncryptedString @fieldCategory\n Currency: Currency @fieldCategory\n Longitude: Longitude @fieldCategory\n Latitude: Latitude @fieldCategory\n Picklist: Picklist @fieldCategory\n MultiPicklist: MultiPicklist @fieldCategory\n Long: Long @fieldCategory\n Double: Double @fieldCategory\n Percent: Percent @fieldCategory\n Base64: Base64 @fieldCategory\n JSON: JSON @fieldCategory\n}\n\ntype DateTimeValue implements FieldValue {\n value: DateTime\n displayValue: String\n format: String\n}\n\ninput RecordDeleteInput {\n Id: IdOrRef!\n}\n\nenum __DirectiveLocation {\n QUERY\n MUTATION\n FIELD\n FRAGMENT_DEFINITION\n FRAGMENT_SPREAD\n INLINE_FRAGMENT\n SCHEMA\n SCALAR\n OBJECT\n FIELD_DEFINITION\n ARGUMENT_DEFINITION\n INTERFACE\n UNION\n ENUM\n ENUM_VALUE\n INPUT_OBJECT\n INPUT_FIELD_DEFINITION\n}\n\ntype IntAggregate implements FieldValue {\n value: Int\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n grouping: IntValue\n max: IntValue\n min: IntValue\n sum: LongValue\n}\n\ntype ListOrder {\n fieldApiName: String!\n sortDirection: ResultOrder\n}\n\ntype RecordAggregate @generic {\n ApiName: String!\n BooleanAggregate: BooleanAggregate @fieldCategory\n CurrencyAggregate: CurrencyAggregate @fieldCategory\n DateAggregate: DateAggregate @fieldCategory\n DoubleAggregate: DoubleAggregate @fieldCategory\n EmailAggregate: EmailAggregate @fieldCategory\n IDAggregate: IDAggregate @fieldCategory\n IntAggregate: IntAggregate @fieldCategory\n LatitudeAggregate: LatitudeAggregate @fieldCategory\n LongitudeAggregate: LongitudeAggregate @fieldCategory\n LongAggregate: LongAggregate @fieldCategory\n PercentAggregate: PercentAggregate @fieldCategory\n PhoneNumberAggregate: PhoneNumberAggregate @fieldCategory\n PicklistAggregate: PicklistAggregate @fieldCategory\n StringAggregate: StringAggregate @fieldCategory\n TextAreaAggregate: TextAreaAggregate @fieldCategory\n TimeAggregate: TimeAggregate @fieldCategory\n UrlAggregate: UrlAggregate @fieldCategory\n}\n\ntype JSONValue implements FieldValue {\n value: JSON\n displayValue: String\n}\n\ntype EmailValue implements FieldValue {\n value: Email\n displayValue: String\n}\n\nenum AggregateOrderByStringFunction {\n COUNT\n COUNT_DISTINCT\n MAX\n MIN\n}\n\ntype LongValue implements FieldValue {\n value: Long\n displayValue: String\n format: String\n}\n\ninput DateFunctionInput {\n value: LongOperators\n convertTimezoneValue: LongOperators\n}\n\n# Mutations aren't supported yet.\n#type Mutation {\n# uiapi: UIAPIMutations!\n#}\n\ntype DependentField {\n controllingField: String!\n dependentFields: [String]!\n}\n\ninput LongTextAreaOperators {\n eq: LongTextArea\n ne: LongTextArea\n like: LongTextArea\n lt: LongTextArea\n gt: LongTextArea\n lte: LongTextArea\n gte: LongTextArea\n in: [LongTextArea]\n nin: [LongTextArea]\n}\n\nenum __TypeKind {\n SCALAR\n OBJECT\n INTERFACE\n UNION\n ENUM\n INPUT_OBJECT\n LIST\n NON_NULL\n}\n\ntype PercentValue implements FieldValue {\n value: Percent\n displayValue: String\n format: String\n}\n\ninput DateTimeOperators {\n eq: DateTimeInput\n ne: DateTimeInput\n lt: DateTimeInput\n gt: DateTimeInput\n lte: DateTimeInput\n gte: DateTimeInput\n in: [DateTimeInput]\n nin: [DateTimeInput]\n DAY_IN_WEEK: DateFunctionInput\n DAY_IN_MONTH: DateFunctionInput\n DAY_IN_YEAR: DateFunctionInput\n WEEK_IN_MONTH: DateFunctionInput\n WEEK_IN_YEAR: DateFunctionInput\n CALENDAR_MONTH: DateFunctionInput\n CALENDAR_QUARTER: DateFunctionInput\n CALENDAR_YEAR: DateFunctionInput\n FISCAL_MONTH: DateFunctionInput\n FISCAL_QUARTER: DateFunctionInput\n FISCAL_YEAR: DateFunctionInput\n DAY_ONLY: DateTimeFunctionInput\n HOUR_IN_DAY: DateFunctionInput\n}\n\ninput NoFunctionAggregateOrderByClause {\n order: ResultsOrder\n nulls: NullsOrder\n}\n\ntype BooleanAggregate implements FieldValue {\n value: Boolean\n displayValue: String\n grouping: IntValue\n}\n\ntype RecordQueryAggregate {\n # RecordScope is replaced with String\n recordQueryAggregate(first: Int, after: String, where: RecordFilter, orderBy: AggregateOrderBy, scope: String, groupBy: RecordGroupBy, upperBound: Int): RecordAggregateConnection @fieldCategory\n}\n\ntype RecordConnection @generic {\n edges: [RecordEdge]\n pageInfo: PageInfo!\n totalCount: Int!\n}\n\ntype FilteredLookupInfo {\n controllingFields: [String]!\n dependent: Boolean!\n optionalFilter: Boolean!\n}\n\ninput PhoneNumberOperators {\n eq: PhoneNumber\n ne: PhoneNumber\n like: PhoneNumber\n lt: PhoneNumber\n gt: PhoneNumber\n lte: PhoneNumber\n gte: PhoneNumber\n in: [PhoneNumber]\n nin: [PhoneNumber]\n}\n\ntype ObjectInfo {\n ApiName: String!\n childRelationships: [ChildRelationship]!\n createable: Boolean!\n custom: Boolean!\n defaultRecordTypeId: ID\n deletable: Boolean!\n dependentFields: [DependentField]!\n feedEnabled: Boolean!\n fields: [Field]!\n keyPrefix: String\n label: String\n labelPlural: String\n layoutable: Boolean!\n mruEnabled: Boolean!\n nameFields: [String]!\n queryable: Boolean!\n recordTypeInfos: [RecordTypeInfo]!\n searchable: Boolean!\n themeInfo: ThemeInfo\n updateable: Boolean!\n}\n\ninput LongitudeOperators {\n eq: Longitude\n ne: Longitude\n lt: Longitude\n gt: Longitude\n lte: Longitude\n gte: Longitude\n in: [Longitude]\n nin: [Longitude]\n}\n\ninput RecordCreateRepresentation @generic {\n Int: Int @fieldCategory\n String: String @fieldCategory\n Boolean: Boolean @fieldCategory\n ID: IdOrRef @fieldCategory\n DateTime: DateTime @fieldCategory\n Time: Time @fieldCategory\n Date: Date @fieldCategory\n TextArea: TextArea @fieldCategory\n LongTextArea: LongTextArea @fieldCategory\n RichTextArea: RichTextArea @fieldCategory\n PhoneNumber: PhoneNumber @fieldCategory\n Email: Email @fieldCategory\n Url: Url @fieldCategory\n EncryptedString: EncryptedString @fieldCategory\n Currency: Currency @fieldCategory\n Longitude: Longitude @fieldCategory\n Latitude: Latitude @fieldCategory\n Picklist: Picklist @fieldCategory\n MultiPicklist: MultiPicklist @fieldCategory\n Long: Long @fieldCategory\n Double: Double @fieldCategory\n Percent: Percent @fieldCategory\n Base64: Base64 @fieldCategory\n JSON: JSON @fieldCategory\n}\n\ntype Field {\n ApiName: String!\n calculated: Boolean!\n compound: Boolean!\n compoundComponentName: String\n compoundFieldName: String\n controllerName: String\n controllingFields: [String]!\n createable: Boolean!\n custom: Boolean!\n dataType: DataType\n extraTypeInfo: FieldExtraTypeInfo\n filterable: Boolean!\n filteredLookupInfo: FilteredLookupInfo\n highScaleNumber: Boolean!\n htmlFormatted: Boolean!\n inlineHelpText: String\n label: String\n nameField: Boolean!\n polymorphicForeignKey: Boolean!\n precision: Int\n reference: Boolean!\n referenceTargetField: String\n referenceToInfos: [ReferenceToInfo]!\n relationshipName: String\n required: Boolean!\n scale: Int\n searchPrefilterable: Boolean\n sortable: Boolean!\n updateable: Boolean!\n}\n\nenum FieldExtraTypeInfo {\n IMAGE_URL\n EXTERNAL_LOOKUP\n INDIRECT_LOOKUP\n PERSONNAME\n SWITCHABLE_PERSONNAME\n PLAINTEXTAREA\n RICHTEXTAREA\n}\n\ntype RateLimit {\n cost: Long\n limit: Long\n remaining: Long\n resetAt: DateTime\n}\n\ninput DateRange {\n last_n_days: Int\n next_n_days: Int\n last_n_weeks: Int\n next_n_weeks: Int\n last_n_months: Int\n next_n_months: Int\n last_n_quarters: Int\n next_n_quarters: Int\n last_n_fiscal_quarters: Int\n next_n_fiscal_quarters: Int\n last_n_years: Int\n next_n_years: Int\n last_n_fiscal_years: Int\n next_n_fiscal_years: Int\n n_days_ago: Int\n n_weeks_ago: Int\n n_months_ago: Int\n n_quarters_ago: Int\n n_years_ago: Int\n n_fiscal_quarters_ago: Int\n n_fiscal_years_ago: Int\n}\n\ntype UIAPIMutations {\n recordCreate(input: RecordCreateInput!): RecordCreatePayload @fieldCategory\n recordDelete(input: RecordDeleteInput!): RecordDeletePayload @fieldCategory\n recordUpdate(input: RecordUpdateInput!): RecordUpdatePayload @fieldCategory\n}\n\ninput DateTimeFunctionInput {\n value: DateTimePrimitiveOperators\n convertTimezoneValue: DateTimePrimitiveOperators\n}\n\ntype Base64Value implements FieldValue {\n value: Base64\n displayValue: String\n}\n\ninput IntegerOperators {\n eq: Int\n ne: Int\n lt: Int\n gt: Int\n lte: Int\n gte: Int\n in: [Int]\n nin: [Int]\n}\n\ntype EncryptedStringValue implements FieldValue {\n value: EncryptedString\n displayValue: String\n}\n\ninterface Record {\n Id: ID!\n ApiName: String!\n WeakEtag: Long!\n DisplayValue: String\n LastModifiedById: IDValue\n LastModifiedDate: DateTimeValue\n SystemModstamp: DateTimeValue\n RecordTypeId(fallback: Boolean): IDValue\n}\n\ninput PolymorphicParentRelationshipRecordFilter @generic {\n RecordFilter: RecordFilter @fieldCategory\n}\n\ninput AggregateOrderByNumberClause {\n function: AggregateOrderByNumberFunction\n order: ResultsOrder\n nulls: NullsOrder\n}\n\ntype __Schema {\n types: [__Type!]!\n queryType: __Type!\n mutationType: __Type\n directives: [__Directive!]!\n subscriptionType: __Type\n}\n\ntype CompoundField @generic {\n IntValue: IntValue @fieldCategory\n StringValue: StringValue @fieldCategory\n BooleanValue: BooleanValue @fieldCategory\n IDValue: IDValue @fieldCategory\n DateTimeValue: DateTimeValue @fieldCategory\n TimeValue: TimeValue @fieldCategory\n DateValue: DateValue @fieldCategory\n TextAreaValue: TextAreaValue @fieldCategory\n LongTextAreaValue: LongTextAreaValue @fieldCategory\n RichTextAreaValue: RichTextAreaValue @fieldCategory\n PhoneNumberValue: PhoneNumberValue @fieldCategory\n EmailValue: EmailValue @fieldCategory\n UrlValue: UrlValue @fieldCategory\n EncryptedStringValue: EncryptedStringValue @fieldCategory\n CurrencyValue: CurrencyValue @fieldCategory\n LongitudeValue: LongitudeValue @fieldCategory\n LatitudeValue: LatitudeValue @fieldCategory\n PicklistValue: PicklistValue @fieldCategory\n MultiPicklistValue: MultiPicklistValue @fieldCategory\n LongValue: LongValue @fieldCategory\n DoubleValue: DoubleValue @fieldCategory\n PercentValue: PercentValue @fieldCategory\n Base64Value: Base64Value @fieldCategory\n JSONValue: JSONValue @fieldCategory\n}\n\ninput RecordUpdateInput @generic {\n Id: IdOrRef!\n record: RecordUpdateRepresentation! @fieldCategory\n}\n\ninput DateTimeInput {\n value: DateTime\n literal: DateLiteral\n range: DateRange\n}\n\ninput DateTimePrimitiveOperators {\n eq: DateTime\n ne: DateTime\n lt: DateTime\n gt: DateTime\n lte: DateTime\n gte: DateTime\n in: [DateTime]\n nin: [DateTime]\n}\n\ntype ChildRelationship {\n childObjectApiName: String!\n fieldName: String\n junctionIdListNames: [String]!\n junctionReferenceTo: [String]!\n relationshipName: String\n objectInfo: ObjectInfo\n}\n\ntype RecordResult @generic {\n aggregate: RecordAggregate\n}\n\ntype PageInfo {\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n startCursor: String\n endCursor: String\n}\n\ntype CurrencyValue implements FieldValue {\n value: Currency\n displayValue: String\n format: String\n}\n\ninput DateInput {\n value: Date\n literal: DateLiteral\n range: DateRange\n}\n\ninput RecordGroupBy @generic {\n groupableField: GroupByClause @fieldCategory\n groupableDateField: GroupByDateFunction @fieldCategory\n groupableParentRelationship: RecordGroupBy @fieldCategory\n groupablePolymorphicParentRelationship: PolymorphicParentRelationshipGroupBy @fieldCategory\n type: GroupByType = GROUP_BY\n}\n\ntype DateFunctionAggregation {\n value: Long\n format: String\n}\n\ntype RecordQuery {\n # scope should be type RecordScope but it cannot currently be used\n recordQuery(first: Int, after: String, where: RecordFilter, orderBy: RecordOrderBy, scope: String, upperBound: Int): RecordConnection @fieldCategory\n}\n\ndirective @generic on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT\ndirective @fieldCategory on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE\ndirective @category on FIELD";
|
|
9301
|
+
var uiapiSchemaString = "scalar String\nscalar DateTime\nscalar Currency\nscalar ID\nscalar Boolean\nscalar Longitude\nscalar Float\nscalar MultiPicklist\nscalar Base64\nscalar Url\nscalar PhoneNumber\nscalar Email\nscalar TextArea\nscalar Latitude\nscalar Picklist\nscalar RichTextArea\nscalar EncryptedString\nscalar Double\nscalar Long\nscalar JSON\nscalar Time\nscalar Int\nscalar Percent\nscalar LongTextArea\nscalar IdOrRef\nscalar Date\ntype PercentAggregate implements FieldValue {\n value: Percent\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n max: PercentValue\n min: PercentValue\n sum: PercentValue\n}\n\ntype StringAggregate implements FieldValue {\n value: String\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n label: String\n max: StringValue\n min: StringValue\n}\n\ntype Query {\n uiapi: UIAPI!\n}\n\ninput EmailOperators {\n eq: Email\n ne: Email\n like: Email\n lt: Email\n gt: Email\n lte: Email\n gte: Email\n in: [Email]\n nin: [Email]\n}\n\ninput PolymorphicParentRelationshipRecordOrderBy @generic {\n RecordOrderBy: RecordOrderBy @fieldCategory\n}\n\ninput DoubleOperators {\n eq: Double\n ne: Double\n lt: Double\n gt: Double\n lte: Double\n gte: Double\n in: [Double]\n nin: [Double]\n}\n\ntype DateOnlyAggregation {\n value: Date\n format: String\n}\n\ntype RecordCreatePayload @generic {\n Record: RecordRepresentation\n}\n\ntype DateAggregate implements FieldValue {\n value: Date\n displayValue: String\n calendarMonth: DateFunctionAggregation\n calendarQuarter: DateFunctionAggregation\n calendarYear: DateFunctionAggregation\n count: LongValue\n countDistinct: LongValue\n dayInMonth: DateFunctionAggregation\n dayInWeek: DateFunctionAggregation\n dayInYear: DateFunctionAggregation\n fiscalMonth: DateFunctionAggregation\n fiscalQuarter: DateFunctionAggregation\n fiscalYear: DateFunctionAggregation\n format: String\n grouping: IntValue\n max: DateValue\n min: DateValue\n weekInMonth: DateFunctionAggregation\n weekInYear: DateFunctionAggregation\n}\n\ninput PolymorphicParentRelationshipGroupBy @generic {\n RecordGroupBy: RecordGroupBy @fieldCategory\n}\n\nenum GroupByFunction {\n DAY_IN_WEEK\n DAY_IN_MONTH\n DAY_IN_YEAR\n WEEK_IN_MONTH\n WEEK_IN_YEAR\n CALENDAR_MONTH\n CALENDAR_QUARTER\n CALENDAR_YEAR\n FISCAL_MONTH\n FISCAL_QUARTER\n FISCAL_YEAR\n DAY_ONLY\n HOUR_IN_DAY\n}\n\ntype RecordTypeInfo {\n available: Boolean!\n defaultRecordTypeMapping: Boolean!\n master: Boolean!\n name: String\n recordTypeId: ID\n}\n\ninput UIAPIMutationsInput {\n allOrNone: Boolean = true\n}\n\ntype BooleanValue implements FieldValue {\n value: Boolean\n displayValue: String\n}\n\ntype ReferenceToInfo {\n ApiName: String!\n nameFields: [String]!\n objectInfo: ObjectInfo\n}\n\ninterface FieldValue {\n displayValue: String\n}\n\ntype LongitudeValue implements FieldValue {\n value: Longitude\n displayValue: String\n}\n\ntype StringValue implements FieldValue {\n value: String\n displayValue: String\n label: String\n}\n\ntype IntValue implements FieldValue {\n value: Int\n displayValue: String\n format: String\n}\n\ntype UrlValue implements FieldValue {\n value: Url\n displayValue: String\n}\n\ninput IdOperators {\n eq: ID\n ne: ID\n lt: ID\n gt: ID\n lte: ID\n gte: ID\n in: [ID]\n nin: [ID]\n inq: JoinInput\n ninq: JoinInput\n}\n\ntype LongAggregate implements FieldValue {\n value: Long\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n grouping: IntValue\n max: LongValue\n min: LongValue\n sum: LongValue\n}\n\ntype PhoneNumberAggregate implements FieldValue {\n value: PhoneNumber\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: PhoneNumberValue\n min: PhoneNumberValue\n}\n\ninput TimeOperators {\n eq: Time\n ne: Time\n lt: Time\n gt: Time\n lte: Time\n gte: Time\n in: [Time]\n nin: [Time]\n}\n\ntype PicklistValue implements FieldValue {\n value: Picklist\n displayValue: String\n label: String\n}\n\ntype CurrencyAggregate implements FieldValue {\n value: Currency\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n max: CurrencyValue\n min: CurrencyValue\n sum: CurrencyValue\n}\n\ntype RelatedListInfo {\n childApiName: String!\n relatedListName: String!\n label: String!\n displayColumns: [ListColumn!]!\n orderedByInfo: [ListOrder!]!\n parentApiName: String!\n fieldApiName: String!\n}\n\ninput StringOperators {\n eq: String\n ne: String\n like: String\n lt: String\n gt: String\n lte: String\n gte: String\n in: [String]\n nin: [String]\n}\n\ntype UIAPI {\n query: RecordQuery!\n aggregate: RecordQueryAggregate!\n objectInfos(apiNames: [String], locale: String): [ObjectInfo]\n relatedListByName(parentApiName: String!, relatedListName: String!): RelatedListInfo\n}\n\ninput MultiPicklistOperators {\n eq: MultiPicklist\n ne: MultiPicklist\n includes: [MultiPicklist]\n excludes: [MultiPicklist]\n}\n\ntype DateTimeAggregate implements FieldValue {\n value: DateTime\n displayValue: String\n calendarMonth: DateFunctionAggregation\n calendarQuarter: DateFunctionAggregation\n calendarYear: DateFunctionAggregation\n count: LongValue\n countDistinct: LongValue\n dayInMonth: DateFunctionAggregation\n dayInWeek: DateFunctionAggregation\n dayInYear: DateFunctionAggregation\n dayOnly: DateOnlyAggregation\n fiscalMonth: DateFunctionAggregation\n fiscalQuarter: DateFunctionAggregation\n fiscalYear: DateFunctionAggregation\n format: String\n hourInDay: DateFunctionAggregation\n max: DateTimeValue\n min: DateTimeValue\n weekInMonth: DateFunctionAggregation\n weekInYear: DateFunctionAggregation\n}\n\ninput BooleanOperators {\n eq: Boolean\n ne: Boolean\n}\n\ntype EmailAggregate implements FieldValue {\n value: Email\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: EmailValue\n min: EmailValue\n}\n\n#enum OrderByType {\n#}\n\ninput GroupByDateFunction {\n function: GroupByFunction\n}\n\ntype RichTextAreaValue implements FieldValue {\n value: RichTextArea\n displayValue: String\n}\n\ntype MultiPicklistValue implements FieldValue {\n value: MultiPicklist\n displayValue: String\n label: String\n}\n\ninput DatePrimitiveOperators {\n eq: Date\n ne: Date\n lt: Date\n gt: Date\n lte: Date\n gte: Date\n in: [Date]\n nin: [Date]\n}\n\ntype TimeAggregate implements FieldValue {\n value: Time\n displayValue: String\n format: String\n hourInDay: DateFunctionAggregation\n}\n\ntype __Type {\n kind: __TypeKind!\n name: String\n description: String\n fields(includeDeprecated: Boolean = false): [__Field!]\n interfaces: [__Type!]\n possibleTypes: [__Type!]\n enumValues(includeDeprecated: Boolean = false): [__EnumValue!]\n inputFields: [__InputValue!]\n ofType: __Type\n}\n\ntype ListColumn {\n fieldApiName: String!\n label: String!\n lookupId: String\n sortable: Boolean\n}\n\ntype LatitudeAggregate implements FieldValue {\n value: Latitude\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n max: LatitudeValue\n min: LatitudeValue\n sum: DoubleValue\n}\n\ninput CurrencyOperators {\n eq: Currency\n ne: Currency\n lt: Currency\n gt: Currency\n lte: Currency\n gte: Currency\n in: [Currency]\n nin: [Currency]\n}\n\ninput DistanceInput {\n latitude: Latitude!\n longitude: Longitude!\n}\n\nunion PolymorphicParentRelationship @generic = RecordRepresentation\n\nenum AggregateOrderByNumberFunction {\n AVG\n COUNT\n COUNT_DISTINCT\n MAX\n MIN\n SUM\n}\n\ntype LongTextAreaValue implements FieldValue {\n value: LongTextArea\n displayValue: String\n}\n\ntype LatitudeValue implements FieldValue {\n value: Latitude\n displayValue: String\n}\n\ninput OrderByClause {\n order: ResultOrder\n nulls: NullOrder\n}\n\ninput AggregateOrderBy @generic {\n orderableNumberField: AggregateOrderByNumberClause @fieldCategory\n orderableStringField: AggregateOrderByStringClause @fieldCategory\n orderableField: NoFunctionAggregateOrderByClause @fieldCategory\n orderableGeolocationField: OrderByGeolocationClause @fieldCategory\n orderableParentRelationship: AggregateOrderBy @fieldCategory\n orderablePolymorphicParentRelationship: PolymorphicParentRelationshipOrderBy @fieldCategory\n type: String = ORDER_BY # Handrolled\n}\n\ninput GroupByClause {\n group: Boolean\n}\n\ntype RecordAggregateConnection @generic {\n edges: [RecordAggregateEdge]\n pageInfo: PageInfo!\n totalCount: Int!\n}\n\ntype LongitudeAggregate implements FieldValue {\n value: Longitude\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n max: LongitudeValue\n min: LongitudeValue\n sum: DoubleValue\n}\n\ntype RecordEdge @generic {\n node: RecordRepresentation\n cursor: String!\n}\n\ntype DateValue implements FieldValue {\n value: Date\n displayValue: String\n format: String\n}\n\ninput URLOperators {\n eq: Url\n ne: Url\n like: Url\n lt: Url\n gt: Url\n lte: Url\n gte: Url\n in: [Url]\n nin: [Url]\n}\n\ninput LongOperators {\n eq: Long\n ne: Long\n lt: Long\n gt: Long\n lte: Long\n gte: Long\n in: [Long]\n nin: [Long]\n}\n\nenum DataType {\n STRING\n TEXTAREA\n PHONE\n EMAIL\n URL\n ENCRYPTEDSTRING\n BOOLEAN\n CURRENCY\n INT\n LONG\n DOUBLE\n PERCENT\n DATETIME\n TIME\n DATE\n REFERENCE\n PICKLIST\n MULTIPICKLIST\n ADDRESS\n LOCATION\n BASE64\n COMPLEXVALUE\n COMBOBOX\n JSON\n JUNCTIONIDLIST\n ANYTYPE\n}\n\nenum NullOrder {\n FIRST\n LAST\n}\n\ntype PhoneNumberValue implements FieldValue {\n value: PhoneNumber\n displayValue: String\n}\n\n# Cannot have empty enum\n# enum RecordScope @generic {\n# }\n\ntype DoubleAggregate implements FieldValue {\n value: Double\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n max: DoubleValue\n min: DoubleValue\n sum: DoubleValue\n}\n\ntype __Field {\n name: String!\n description: String\n args: [__InputValue!]!\n type: __Type!\n isDeprecated: Boolean!\n deprecationReason: String\n}\n\ninput DateOperators {\n eq: DateInput\n ne: DateInput\n lt: DateInput\n gt: DateInput\n lte: DateInput\n gte: DateInput\n in: [DateInput]\n nin: [DateInput]\n DAY_IN_WEEK: DateFunctionInput\n DAY_IN_MONTH: DateFunctionInput\n DAY_IN_YEAR: DateFunctionInput\n WEEK_IN_MONTH: DateFunctionInput\n WEEK_IN_YEAR: DateFunctionInput\n CALENDAR_MONTH: DateFunctionInput\n CALENDAR_QUARTER: DateFunctionInput\n CALENDAR_YEAR: DateFunctionInput\n FISCAL_MONTH: DateFunctionInput\n FISCAL_QUARTER: DateFunctionInput\n FISCAL_YEAR: DateFunctionInput\n}\n\ninput GeolocationInput {\n latitude: Latitude!\n longitude: Longitude!\n radius: Float!\n unit: Unit!\n}\n\ninput JoinInput {\n Record: RecordFilter @fieldCategory\n ApiName: String\n}\n\ninput TextAreaOperators {\n eq: TextArea\n ne: TextArea\n like: TextArea\n lt: TextArea\n gt: TextArea\n lte: TextArea\n gte: TextArea\n in: [TextArea]\n nin: [TextArea]\n}\n\ntype TextAreaValue implements FieldValue {\n value: TextArea\n displayValue: String\n}\n\ntype RecordUpdatePayload @generic {\n success: Boolean\n}\n\ninput PercentOperators {\n eq: Percent\n ne: Percent\n lt: Percent\n gt: Percent\n lte: Percent\n gte: Percent\n in: [Percent]\n nin: [Percent]\n}\n\ntype DoubleValue implements FieldValue {\n value: Double\n displayValue: String\n format: String\n}\n\ntype IDAggregate implements FieldValue {\n value: ID\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: IDValue\n min: IDValue\n}\n\ntype __InputValue {\n name: String!\n description: String\n type: __Type!\n defaultValue: String\n}\n\ntype RecordAggregateEdge @generic {\n node: RecordResult\n cursor: String!\n}\n\ntype __Directive {\n name: String\n description: String\n locations: [__DirectiveLocation!]\n args: [__InputValue!]!\n}\n\ninput RecordCreateInput @generic {\n record: RecordCreateRepresentation! @fieldCategory\n}\n\ntype ThemeInfo {\n color: String\n iconUrl: String\n}\n\ninput AggregateOrderByStringClause {\n function: AggregateOrderByStringFunction\n order: ResultsOrder\n nulls: NullsOrder\n}\n\ntype RecordDeletePayload {\n Id: ID\n}\n\ntype UrlAggregate implements FieldValue {\n value: Url\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: UrlValue\n min: UrlValue\n}\n\nenum DateLiteral {\n NEXT_QUARTER\n THIS_FISCAL_YEAR\n NEXT_FISCAL_YEAR\n THIS_WEEK\n LAST_YEAR\n NEXT_FISCAL_QUARTER\n THIS_MONTH\n THIS_YEAR\n LAST_FISCAL_YEAR\n LAST_WEEK\n LAST_90_DAYS\n THIS_FISCAL_QUARTER\n NEXT_YEAR\n NEXT_90_DAYS\n LAST_QUARTER\n LAST_FISCAL_QUARTER\n NEXT_WEEK\n TODAY\n YESTERDAY\n LAST_MONTH\n TOMORROW\n NEXT_MONTH\n THIS_QUARTER\n}\n\ntype __EnumValue {\n name: String!\n description: String\n isDeprecated: Boolean!\n deprecationReason: String\n}\n\ntype RecordRepresentation implements Record @generic{\n Id: ID!\n ApiName: String!\n WeakEtag: Long!\n DisplayValue: String\n LastModifiedById: IDValue\n LastModifiedDate: DateTimeValue\n SystemModstamp: DateTimeValue\n RecordTypeId(fallback: Boolean): IDValue\n IntValue: IntValue @fieldCategory\n StringValue: StringValue @fieldCategory\n BooleanValue: BooleanValue @fieldCategory\n IDValue: IDValue @fieldCategory\n DateTimeValue: DateTimeValue @fieldCategory\n TimeValue: TimeValue @fieldCategory\n DateValue: DateValue @fieldCategory\n TextAreaValue: TextAreaValue @fieldCategory\n LongTextAreaValue: LongTextAreaValue @fieldCategory\n RichTextAreaValue: RichTextAreaValue @fieldCategory\n PhoneNumberValue: PhoneNumberValue @fieldCategory\n EmailValue: EmailValue @fieldCategory\n UrlValue: UrlValue @fieldCategory\n EncryptedStringValue: EncryptedStringValue @fieldCategory\n CurrencyValue: CurrencyValue @fieldCategory\n LongitudeValue: LongitudeValue @fieldCategory\n LatitudeValue: LatitudeValue @fieldCategory\n PicklistValue: PicklistValue @fieldCategory\n MultiPicklistValue: MultiPicklistValue @fieldCategory\n LongValue: LongValue @fieldCategory\n DoubleValue: DoubleValue @fieldCategory\n PercentValue: PercentValue @fieldCategory\n Base64Value: Base64Value @fieldCategory\n JSONValue: JSONValue @fieldCategory\n parentRelationship: RecordRepresentation @fieldCategory\n polymorphicParentRelationship: PolymorphicParentRelationship @fieldCategory\n childRelationship(first: Int, after: String, where: RecordFilter, orderBy: RecordOrderBy, upperBound: Int): RecordConnection @fieldCategory\n CompoundField: CompoundField @fieldCategory\n}\n\ntype IDValue implements FieldValue {\n value: ID\n displayValue: String\n}\n\nenum Unit {\n MI\n KM\n}\n\ninput PolymorphicParentRelationshipOrderBy @generic {\n AggregateOrderBy: AggregateOrderBy @fieldCategory\n}\n\ninput OrderByGeolocationClause {\n distance: DistanceInput\n order: ResultOrder\n nulls: NullOrder\n}\n\nenum NullsOrder {\n FIRST\n LAST\n}\n\ntype TextAreaAggregate implements FieldValue {\n value: TextArea\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n max: TextAreaValue\n min: TextAreaValue\n}\n\nenum GroupByType {\n GROUP_BY\n ROLLUP\n CUBE\n}\n\nenum ResultOrder {\n ASC\n DESC\n}\n\ninput RecordOrderBy @generic {\n orderableField: OrderByClause @fieldCategory\n orderableGeolocationField: OrderByGeolocationClause @fieldCategory\n orderableParentRelationship: RecordOrderBy @fieldCategory\n orderablePolymorphicParentRelationship: PolymorphicParentRelationshipRecordOrderBy @fieldCategory\n}\n\ninput PicklistOperators {\n eq: Picklist\n ne: Picklist\n in: [Picklist]\n nin: [Picklist]\n like: Picklist\n lt: Picklist\n gt: Picklist\n lte: Picklist\n gte: Picklist\n}\n\nenum ResultsOrder {\n ASC\n DESC\n}\n\ninput RecordFilter @generic {\n and: [RecordFilter]\n or: [RecordFilter]\n not: RecordFilter\n parentRelationshipRecordFilter: RecordFilter @fieldCategory\n polymorphicParentRelationshipRecordFilter: PolymorphicParentRelationshipRecordFilter @fieldCategory\n IntegerOperator: IntegerOperators @fieldCategory\n LongOperator: LongOperators @fieldCategory\n StringOperator: StringOperators @fieldCategory\n DoubleOperator: DoubleOperators @fieldCategory\n PercentOperator: PercentOperators @fieldCategory\n LongitudeOperator: LongitudeOperators @fieldCategory\n LatitudeOperator: LatitudeOperators @fieldCategory\n EmailOperator: EmailOperators @fieldCategory\n TextAreaOperator: TextAreaOperators @fieldCategory\n LongTextAreaOperator: LongTextAreaOperators @fieldCategory\n URLOperator: URLOperators @fieldCategory\n PhoneNumberOperator: PhoneNumberOperators @fieldCategory\n BooleanOperator: BooleanOperators @fieldCategory\n IdOperator: IdOperators @fieldCategory\n CurrencyOperator: CurrencyOperators @fieldCategory\n TimeOperator: TimeOperators @fieldCategory\n DateOperator: DateOperators @fieldCategory\n DateTimeOperator: DateTimeOperators @fieldCategory\n PicklistOperator: PicklistOperators @fieldCategory\n MultiPicklistOperator: MultiPicklistOperators @fieldCategory\n GeolocationOperator: GeolocationOperators @fieldCategory\n}\n\ntype TimeValue implements FieldValue {\n value: Time\n displayValue: String\n format: String\n}\n\ninput GeolocationOperators {\n lt: GeolocationInput\n gt: GeolocationInput\n}\n\ntype PicklistAggregate implements FieldValue {\n value: Picklist\n displayValue: String\n count: LongValue\n countDistinct: LongValue\n grouping: IntValue\n label: String\n max: PicklistValue\n min: PicklistValue\n}\n\ninput LatitudeOperators {\n eq: Latitude\n ne: Latitude\n lt: Latitude\n gt: Latitude\n lte: Latitude\n gte: Latitude\n in: [Latitude]\n nin: [Latitude]\n}\n\ninput RecordUpdateRepresentation @generic {\n Int: Int @fieldCategory\n String: String @fieldCategory\n Boolean: Boolean @fieldCategory\n ID: IdOrRef @fieldCategory\n DateTime: DateTime @fieldCategory\n Time: Time @fieldCategory\n Date: Date @fieldCategory\n TextArea: TextArea @fieldCategory\n LongTextArea: LongTextArea @fieldCategory\n RichTextArea: RichTextArea @fieldCategory\n PhoneNumber: PhoneNumber @fieldCategory\n Email: Email @fieldCategory\n Url: Url @fieldCategory\n EncryptedString: EncryptedString @fieldCategory\n Currency: Currency @fieldCategory\n Longitude: Longitude @fieldCategory\n Latitude: Latitude @fieldCategory\n Picklist: Picklist @fieldCategory\n MultiPicklist: MultiPicklist @fieldCategory\n Long: Long @fieldCategory\n Double: Double @fieldCategory\n Percent: Percent @fieldCategory\n Base64: Base64 @fieldCategory\n JSON: JSON @fieldCategory\n}\n\ntype DateTimeValue implements FieldValue {\n value: DateTime\n displayValue: String\n format: String\n}\n\ninput RecordDeleteInput {\n Id: IdOrRef!\n}\n\nenum __DirectiveLocation {\n QUERY\n MUTATION\n FIELD\n FRAGMENT_DEFINITION\n FRAGMENT_SPREAD\n INLINE_FRAGMENT\n SCHEMA\n SCALAR\n OBJECT\n FIELD_DEFINITION\n ARGUMENT_DEFINITION\n INTERFACE\n UNION\n ENUM\n ENUM_VALUE\n INPUT_OBJECT\n INPUT_FIELD_DEFINITION\n}\n\ntype IntAggregate implements FieldValue {\n value: Int\n displayValue: String\n avg: DoubleValue\n count: LongValue\n countDistinct: LongValue\n format: String\n grouping: IntValue\n max: IntValue\n min: IntValue\n sum: LongValue\n}\n\ntype ListOrder {\n fieldApiName: String!\n sortDirection: ResultOrder\n}\n\ntype RecordAggregate @generic {\n ApiName: String!\n BooleanAggregate: BooleanAggregate @fieldCategory\n CurrencyAggregate: CurrencyAggregate @fieldCategory\n DateAggregate: DateAggregate @fieldCategory\n DoubleAggregate: DoubleAggregate @fieldCategory\n EmailAggregate: EmailAggregate @fieldCategory\n IDAggregate: IDAggregate @fieldCategory\n IntAggregate: IntAggregate @fieldCategory\n LatitudeAggregate: LatitudeAggregate @fieldCategory\n LongitudeAggregate: LongitudeAggregate @fieldCategory\n LongAggregate: LongAggregate @fieldCategory\n PercentAggregate: PercentAggregate @fieldCategory\n PhoneNumberAggregate: PhoneNumberAggregate @fieldCategory\n PicklistAggregate: PicklistAggregate @fieldCategory\n StringAggregate: StringAggregate @fieldCategory\n TextAreaAggregate: TextAreaAggregate @fieldCategory\n TimeAggregate: TimeAggregate @fieldCategory\n UrlAggregate: UrlAggregate @fieldCategory\n}\n\ntype JSONValue implements FieldValue {\n value: JSON\n displayValue: String\n}\n\ntype EmailValue implements FieldValue {\n value: Email\n displayValue: String\n}\n\nenum AggregateOrderByStringFunction {\n COUNT\n COUNT_DISTINCT\n MAX\n MIN\n}\n\ntype LongValue implements FieldValue {\n value: Long\n displayValue: String\n format: String\n}\n\ninput DateFunctionInput {\n value: LongOperators\n convertTimezoneValue: LongOperators\n}\n\n# Mutations aren't supported yet.\n#type Mutation {\n# uiapi(input: UIAPIMutationsInput): UIAPIMutations!\n#}\n\ntype DependentField {\n controllingField: String!\n dependentFields: [String]!\n}\n\ninput LongTextAreaOperators {\n eq: LongTextArea\n ne: LongTextArea\n like: LongTextArea\n lt: LongTextArea\n gt: LongTextArea\n lte: LongTextArea\n gte: LongTextArea\n in: [LongTextArea]\n nin: [LongTextArea]\n}\n\nenum __TypeKind {\n SCALAR\n OBJECT\n INTERFACE\n UNION\n ENUM\n INPUT_OBJECT\n LIST\n NON_NULL\n}\n\ntype PercentValue implements FieldValue {\n value: Percent\n displayValue: String\n format: String\n}\n\ninput DateTimeOperators {\n eq: DateTimeInput\n ne: DateTimeInput\n lt: DateTimeInput\n gt: DateTimeInput\n lte: DateTimeInput\n gte: DateTimeInput\n in: [DateTimeInput]\n nin: [DateTimeInput]\n DAY_IN_WEEK: DateFunctionInput\n DAY_IN_MONTH: DateFunctionInput\n DAY_IN_YEAR: DateFunctionInput\n WEEK_IN_MONTH: DateFunctionInput\n WEEK_IN_YEAR: DateFunctionInput\n CALENDAR_MONTH: DateFunctionInput\n CALENDAR_QUARTER: DateFunctionInput\n CALENDAR_YEAR: DateFunctionInput\n FISCAL_MONTH: DateFunctionInput\n FISCAL_QUARTER: DateFunctionInput\n FISCAL_YEAR: DateFunctionInput\n DAY_ONLY: DateTimeFunctionInput\n HOUR_IN_DAY: DateFunctionInput\n}\n\ninput NoFunctionAggregateOrderByClause {\n order: ResultsOrder\n nulls: NullsOrder\n}\n\ntype BooleanAggregate implements FieldValue {\n value: Boolean\n displayValue: String\n grouping: IntValue\n}\n\ntype RecordQueryAggregate {\n # RecordScope is replaced with String\n recordQueryAggregate(first: Int, after: String, where: RecordFilter, orderBy: AggregateOrderBy, scope: String, groupBy: RecordGroupBy, upperBound: Int): RecordAggregateConnection @fieldCategory\n}\n\ntype RecordConnection @generic {\n edges: [RecordEdge]\n pageInfo: PageInfo!\n totalCount: Int!\n}\n\ntype FilteredLookupInfo {\n controllingFields: [String]!\n dependent: Boolean!\n optionalFilter: Boolean!\n}\n\ninput PhoneNumberOperators {\n eq: PhoneNumber\n ne: PhoneNumber\n like: PhoneNumber\n lt: PhoneNumber\n gt: PhoneNumber\n lte: PhoneNumber\n gte: PhoneNumber\n in: [PhoneNumber]\n nin: [PhoneNumber]\n}\n\ntype ObjectInfo {\n ApiName: String!\n childRelationships: [ChildRelationship]!\n createable: Boolean!\n custom: Boolean!\n defaultRecordTypeId: ID\n deletable: Boolean!\n dependentFields: [DependentField]!\n feedEnabled: Boolean!\n fields: [Field]!\n keyPrefix: String\n label: String\n labelPlural: String\n layoutable: Boolean!\n mruEnabled: Boolean!\n nameFields: [String]!\n queryable: Boolean!\n recordTypeInfos: [RecordTypeInfo]!\n searchable: Boolean!\n themeInfo: ThemeInfo\n updateable: Boolean!\n locale: String\n}\n\ninput LongitudeOperators {\n eq: Longitude\n ne: Longitude\n lt: Longitude\n gt: Longitude\n lte: Longitude\n gte: Longitude\n in: [Longitude]\n nin: [Longitude]\n}\n\ninput RecordCreateRepresentation @generic {\n Int: Int @fieldCategory\n String: String @fieldCategory\n Boolean: Boolean @fieldCategory\n ID: IdOrRef @fieldCategory\n DateTime: DateTime @fieldCategory\n Time: Time @fieldCategory\n Date: Date @fieldCategory\n TextArea: TextArea @fieldCategory\n LongTextArea: LongTextArea @fieldCategory\n RichTextArea: RichTextArea @fieldCategory\n PhoneNumber: PhoneNumber @fieldCategory\n Email: Email @fieldCategory\n Url: Url @fieldCategory\n EncryptedString: EncryptedString @fieldCategory\n Currency: Currency @fieldCategory\n Longitude: Longitude @fieldCategory\n Latitude: Latitude @fieldCategory\n Picklist: Picklist @fieldCategory\n MultiPicklist: MultiPicklist @fieldCategory\n Long: Long @fieldCategory\n Double: Double @fieldCategory\n Percent: Percent @fieldCategory\n Base64: Base64 @fieldCategory\n JSON: JSON @fieldCategory\n}\n\ntype Field {\n ApiName: String!\n calculated: Boolean!\n compound: Boolean!\n compoundComponentName: String\n compoundFieldName: String\n controllerName: String\n controllingFields: [String]!\n createable: Boolean!\n custom: Boolean!\n dataType: DataType\n extraTypeInfo: FieldExtraTypeInfo\n filterable: Boolean!\n filteredLookupInfo: FilteredLookupInfo\n highScaleNumber: Boolean!\n htmlFormatted: Boolean!\n inlineHelpText: String\n label: String\n nameField: Boolean!\n polymorphicForeignKey: Boolean!\n precision: Int\n reference: Boolean!\n referenceTargetField: String\n referenceToInfos: [ReferenceToInfo]!\n relationshipName: String\n required: Boolean!\n scale: Int\n searchPrefilterable: Boolean\n sortable: Boolean!\n updateable: Boolean!\n}\n\nenum FieldExtraTypeInfo {\n IMAGE_URL\n EXTERNAL_LOOKUP\n INDIRECT_LOOKUP\n PERSONNAME\n SWITCHABLE_PERSONNAME\n PLAINTEXTAREA\n RICHTEXTAREA\n}\n\ntype RateLimit {\n cost: Long\n limit: Long\n remaining: Long\n resetAt: DateTime\n}\n\ninput DateRange {\n last_n_days: Int\n next_n_days: Int\n last_n_weeks: Int\n next_n_weeks: Int\n last_n_months: Int\n next_n_months: Int\n last_n_quarters: Int\n next_n_quarters: Int\n last_n_fiscal_quarters: Int\n next_n_fiscal_quarters: Int\n last_n_years: Int\n next_n_years: Int\n last_n_fiscal_years: Int\n next_n_fiscal_years: Int\n n_days_ago: Int\n n_weeks_ago: Int\n n_months_ago: Int\n n_quarters_ago: Int\n n_years_ago: Int\n n_fiscal_quarters_ago: Int\n n_fiscal_years_ago: Int\n}\n\ntype UIAPIMutations {\n recordCreate(input: RecordCreateInput!): RecordCreatePayload @fieldCategory\n recordDelete(input: RecordDeleteInput!): RecordDeletePayload @fieldCategory\n recordUpdate(input: RecordUpdateInput!): RecordUpdatePayload @fieldCategory\n}\n\ninput DateTimeFunctionInput {\n value: DatePrimitiveOperators\n convertTimezoneValue: DatePrimitiveOperators\n}\n\ntype Base64Value implements FieldValue {\n value: Base64\n displayValue: String\n}\n\ninput IntegerOperators {\n eq: Int\n ne: Int\n lt: Int\n gt: Int\n lte: Int\n gte: Int\n in: [Int]\n nin: [Int]\n}\n\ntype EncryptedStringValue implements FieldValue {\n value: EncryptedString\n displayValue: String\n}\n\ninterface Record {\n Id: ID!\n ApiName: String!\n WeakEtag: Long!\n DisplayValue: String\n LastModifiedById: IDValue\n LastModifiedDate: DateTimeValue\n SystemModstamp: DateTimeValue\n RecordTypeId(fallback: Boolean): IDValue\n}\n\ninput PolymorphicParentRelationshipRecordFilter @generic {\n RecordFilter: RecordFilter @fieldCategory\n}\n\ninput AggregateOrderByNumberClause {\n function: AggregateOrderByNumberFunction\n order: ResultsOrder\n nulls: NullsOrder\n}\n\ntype __Schema {\n types: [__Type!]!\n queryType: __Type!\n mutationType: __Type\n directives: [__Directive!]!\n subscriptionType: __Type\n}\n\ntype CompoundField @generic {\n IntValue: IntValue @fieldCategory\n StringValue: StringValue @fieldCategory\n BooleanValue: BooleanValue @fieldCategory\n IDValue: IDValue @fieldCategory\n DateTimeValue: DateTimeValue @fieldCategory\n TimeValue: TimeValue @fieldCategory\n DateValue: DateValue @fieldCategory\n TextAreaValue: TextAreaValue @fieldCategory\n LongTextAreaValue: LongTextAreaValue @fieldCategory\n RichTextAreaValue: RichTextAreaValue @fieldCategory\n PhoneNumberValue: PhoneNumberValue @fieldCategory\n EmailValue: EmailValue @fieldCategory\n UrlValue: UrlValue @fieldCategory\n EncryptedStringValue: EncryptedStringValue @fieldCategory\n CurrencyValue: CurrencyValue @fieldCategory\n LongitudeValue: LongitudeValue @fieldCategory\n LatitudeValue: LatitudeValue @fieldCategory\n PicklistValue: PicklistValue @fieldCategory\n MultiPicklistValue: MultiPicklistValue @fieldCategory\n LongValue: LongValue @fieldCategory\n DoubleValue: DoubleValue @fieldCategory\n PercentValue: PercentValue @fieldCategory\n Base64Value: Base64Value @fieldCategory\n JSONValue: JSONValue @fieldCategory\n}\n\ninput RecordUpdateInput @generic {\n Id: IdOrRef!\n record: RecordUpdateRepresentation! @fieldCategory\n}\n\ninput DateTimeInput {\n value: DateTime\n literal: DateLiteral\n range: DateRange\n}\n\ntype ChildRelationship {\n childObjectApiName: String!\n fieldName: String\n junctionIdListNames: [String]!\n junctionReferenceTo: [String]!\n relationshipName: String\n objectInfo: ObjectInfo\n}\n\ntype RecordResult @generic {\n aggregate: RecordAggregate\n}\n\ntype PageInfo {\n hasNextPage: Boolean!\n hasPreviousPage: Boolean!\n startCursor: String\n endCursor: String\n}\n\ntype CurrencyValue implements FieldValue {\n value: Currency\n displayValue: String\n format: String\n}\n\ninput DateInput {\n value: Date\n literal: DateLiteral\n range: DateRange\n}\n\ninput RecordGroupBy @generic {\n groupableField: GroupByClause @fieldCategory\n groupableDateField: GroupByDateFunction @fieldCategory\n groupableParentRelationship: RecordGroupBy @fieldCategory\n groupablePolymorphicParentRelationship: PolymorphicParentRelationshipGroupBy @fieldCategory\n type: GroupByType = GROUP_BY\n}\n\ntype DateFunctionAggregation {\n value: Long\n format: String\n}\n\ntype RecordQuery {\n # scope should be type RecordScope but that's empty enum.\n recordQuery(first: Int, after: String, where: RecordFilter, orderBy: RecordOrderBy, scope: String, upperBound: Int): RecordConnection @fieldCategory\n}\n\ndirective @generic on OBJECT | INTERFACE | UNION | ENUM | INPUT_OBJECT\ndirective @fieldCategory on FIELD_DEFINITION | ARGUMENT_DEFINITION | INPUT_FIELD_DEFINITION | ENUM_VALUE\ndirective @category(name: String!) on FIELD";
|
|
9245
9302
|
|
|
9246
9303
|
// Define additional schema that is missing from uiapi that we use in local evaluation
|
|
9247
9304
|
const additionalSchemaDefinitions = /* GraphQL */ `
|
|
@@ -9251,25 +9308,6 @@ const additionalSchemaDefinitions = /* GraphQL */ `
|
|
|
9251
9308
|
}
|
|
9252
9309
|
`;
|
|
9253
9310
|
const baseTypeDefinitions = uiapiSchemaString + additionalSchemaDefinitions;
|
|
9254
|
-
/**
|
|
9255
|
-
*
|
|
9256
|
-
* @param objectInfos
|
|
9257
|
-
* @returns Type definition string and entity type names which support polymorphism.
|
|
9258
|
-
*/
|
|
9259
|
-
function generateTypeDefinitions(objectInfos) {
|
|
9260
|
-
if (keys$4(objectInfos).length === 0)
|
|
9261
|
-
return { typeDefs: baseTypeDefinitions, polyFieldTypeNames: [] };
|
|
9262
|
-
const { recordQueries, recordConnections, polyFieldTypeNameArr } = generateRecordQueries(objectInfos);
|
|
9263
|
-
const typeDefs = `
|
|
9264
|
-
${baseTypeDefinitions}
|
|
9265
|
-
|
|
9266
|
-
extend type RecordQuery {
|
|
9267
|
-
${recordQueries}
|
|
9268
|
-
}
|
|
9269
|
-
${recordConnections}
|
|
9270
|
-
`;
|
|
9271
|
-
return { typeDefs, polyFieldTypeNames: polyFieldTypeNameArr };
|
|
9272
|
-
}
|
|
9273
9311
|
const fieldsStaticallyAdded = [
|
|
9274
9312
|
'ApiName',
|
|
9275
9313
|
'DisplayValue',
|
|
@@ -9279,99 +9317,340 @@ const fieldsStaticallyAdded = [
|
|
|
9279
9317
|
'SystemModstamp',
|
|
9280
9318
|
'WeakEtag',
|
|
9281
9319
|
];
|
|
9282
|
-
|
|
9320
|
+
class CachedGraphQLSchema {
|
|
9321
|
+
constructor() {
|
|
9322
|
+
this._schema = buildBaseSchema();
|
|
9323
|
+
this._polymorphicFieldTypeNames = [];
|
|
9324
|
+
}
|
|
9325
|
+
getSchema() {
|
|
9326
|
+
return this._schema;
|
|
9327
|
+
}
|
|
9328
|
+
setSchema(value) {
|
|
9329
|
+
this._schema = value;
|
|
9330
|
+
}
|
|
9331
|
+
getPolymorphicFieldTypeNames() {
|
|
9332
|
+
return this._polymorphicFieldTypeNames;
|
|
9333
|
+
}
|
|
9334
|
+
setPolymorphicFieldTypeNames(value) {
|
|
9335
|
+
this._polymorphicFieldTypeNames = value;
|
|
9336
|
+
}
|
|
9337
|
+
set(schema, polymorphicFieldTypeNames) {
|
|
9338
|
+
this._schema = schema;
|
|
9339
|
+
this._polymorphicFieldTypeNames = polymorphicFieldTypeNames;
|
|
9340
|
+
}
|
|
9341
|
+
}
|
|
9342
|
+
/**
|
|
9343
|
+
* Looks at the injected object info map and checks to see if the existing objects
|
|
9344
|
+
* are within the current schema. It will extend the cached schema if it is not included.
|
|
9345
|
+
* @param objectInfos
|
|
9346
|
+
* @param cache
|
|
9347
|
+
* @returns GraphQLSchema
|
|
9348
|
+
*/
|
|
9349
|
+
function createSchemaWithCache(objectInfos, cache) {
|
|
9350
|
+
const updatedCache = extendSchemaWithObjectInfos(cache, objectInfos);
|
|
9351
|
+
// set the new values to the passed cached schema & polymorphic field names
|
|
9352
|
+
cache.set(updatedCache.getSchema(), updatedCache.getPolymorphicFieldTypeNames());
|
|
9353
|
+
return cache.getSchema();
|
|
9354
|
+
}
|
|
9355
|
+
/**
|
|
9356
|
+
* Extends the current GraphQL Schema with new types based on the given object info map
|
|
9357
|
+
*
|
|
9358
|
+
* @param cache the existing cached schema object
|
|
9359
|
+
* @param objectInfoMap map of object info and apiname for key
|
|
9360
|
+
* @returns CachedGraphQLSchema
|
|
9361
|
+
*/
|
|
9362
|
+
function extendSchemaWithObjectInfos(cache, objectInfoMap) {
|
|
9363
|
+
const { recordQueries, recordConnections, recordExtensions, polyFieldTypeNameArr } = generateRecordQueries(cache.getSchema(), objectInfoMap);
|
|
9364
|
+
const typeDefs = `
|
|
9365
|
+
${recordQueries}
|
|
9366
|
+
${recordConnections}
|
|
9367
|
+
${recordExtensions}
|
|
9368
|
+
`;
|
|
9369
|
+
// if nothing new is added then return the current cache
|
|
9370
|
+
if (typeDefs.trim().length === 0) {
|
|
9371
|
+
return cache;
|
|
9372
|
+
}
|
|
9373
|
+
// parse extensions into DocumentNode to extend the schema
|
|
9374
|
+
const extensions = parse$7(typeDefs);
|
|
9375
|
+
const polymorphicFieldTypeNames = [
|
|
9376
|
+
...polyFieldTypeNameArr,
|
|
9377
|
+
...cache.getPolymorphicFieldTypeNames(),
|
|
9378
|
+
];
|
|
9379
|
+
// extend the schema and add resolvers
|
|
9380
|
+
const schema = addResolversToSchema(extendSchema(cache.getSchema(), extensions), polymorphicFieldTypeNames);
|
|
9381
|
+
cache.setSchema(schema);
|
|
9382
|
+
return cache;
|
|
9383
|
+
}
|
|
9384
|
+
/**
|
|
9385
|
+
* Builds the base schema from uiapi graphql adapter with resolvers attached
|
|
9386
|
+
* @returns GraphQLSchema
|
|
9387
|
+
*/
|
|
9388
|
+
function buildBaseSchema() {
|
|
9389
|
+
return addResolversToSchema(buildSchema(baseTypeDefinitions), []);
|
|
9390
|
+
}
|
|
9391
|
+
/**
|
|
9392
|
+
* Given the existing schema and the object infos it will create a new type for the schema
|
|
9393
|
+
* or extend an existing type to add new fields to it.
|
|
9394
|
+
*
|
|
9395
|
+
* Extends RecordQuery to add new top level queries
|
|
9396
|
+
* extend type RecordQuery {
|
|
9397
|
+
* Account(predicates): AccountConnection
|
|
9398
|
+
* }
|
|
9399
|
+
* @param schema
|
|
9400
|
+
* @param objectInfoMap
|
|
9401
|
+
* @returns
|
|
9402
|
+
*/
|
|
9403
|
+
function generateRecordQueries(schema, objectInfoMap) {
|
|
9283
9404
|
let recordQueries = ``;
|
|
9284
9405
|
let recordConnections = ``;
|
|
9285
|
-
|
|
9406
|
+
let recordExtensions = ``;
|
|
9407
|
+
// use a set to not allow duplicate scalars causing error(s)
|
|
9408
|
+
let addedTypedScalars = new Set();
|
|
9409
|
+
let allPolymorphicFieldTypeNames = new Set();
|
|
9410
|
+
for (const name of keys$4(objectInfoMap)) {
|
|
9411
|
+
const objectInfo = objectInfoMap[name];
|
|
9412
|
+
const { apiName } = objectInfo;
|
|
9413
|
+
const type = schema.getType(apiName);
|
|
9414
|
+
// if type is an ObjectType it exists in the schema
|
|
9415
|
+
if (isObjectType(type)) {
|
|
9416
|
+
const { recordExtension, typedScalars, polymorphicFieldTypeNames } = extendExistingRecordType(schema, type, objectInfo, objectInfoMap);
|
|
9417
|
+
recordExtensions += recordExtension;
|
|
9418
|
+
addedTypedScalars = new Set([...addedTypedScalars, ...typedScalars]);
|
|
9419
|
+
allPolymorphicFieldTypeNames = new Set([
|
|
9420
|
+
...allPolymorphicFieldTypeNames,
|
|
9421
|
+
...polymorphicFieldTypeNames,
|
|
9422
|
+
]);
|
|
9423
|
+
}
|
|
9424
|
+
else {
|
|
9425
|
+
const { recordQueries: newRecordQueries, recordConnections: newRecordConnections, typedScalars, polymorphicFieldTypeNames, } = createNewRecordQuery(schema, objectInfo, objectInfoMap);
|
|
9426
|
+
recordQueries += newRecordQueries;
|
|
9427
|
+
recordConnections += newRecordConnections;
|
|
9428
|
+
addedTypedScalars = new Set([...addedTypedScalars, ...typedScalars]);
|
|
9429
|
+
allPolymorphicFieldTypeNames = new Set([
|
|
9430
|
+
...allPolymorphicFieldTypeNames,
|
|
9431
|
+
...polymorphicFieldTypeNames,
|
|
9432
|
+
]);
|
|
9433
|
+
}
|
|
9434
|
+
}
|
|
9435
|
+
// transform added scalar types into a list of scalars in string
|
|
9436
|
+
const scalars = [...addedTypedScalars].map((scalar) => `scalar ${scalar}`).join('\n');
|
|
9437
|
+
recordConnections += scalars;
|
|
9438
|
+
// return empty string if no recordQueries were extended
|
|
9439
|
+
const extensionWrapper = recordQueries.length > 0
|
|
9440
|
+
? `
|
|
9441
|
+
extend type RecordQuery {
|
|
9442
|
+
${recordQueries}
|
|
9443
|
+
}`
|
|
9444
|
+
: '';
|
|
9445
|
+
return {
|
|
9446
|
+
recordQueries: extensionWrapper,
|
|
9447
|
+
recordConnections,
|
|
9448
|
+
recordExtensions,
|
|
9449
|
+
polyFieldTypeNameArr: from$1(allPolymorphicFieldTypeNames),
|
|
9450
|
+
};
|
|
9451
|
+
}
|
|
9452
|
+
/**
|
|
9453
|
+
* Will create a new record query extension for something that does not already exist in the schema
|
|
9454
|
+
*
|
|
9455
|
+
* generates:
|
|
9456
|
+
*
|
|
9457
|
+
* type {typename} implements Record {
|
|
9458
|
+
* ...scalar fields
|
|
9459
|
+
* Id: IDValue
|
|
9460
|
+
* ...spanning parent records
|
|
9461
|
+
* User: Parent
|
|
9462
|
+
* ...spanning children queries
|
|
9463
|
+
* Accounts(predicates): AccountConnection
|
|
9464
|
+
* }
|
|
9465
|
+
*
|
|
9466
|
+
* scalars SomeAddedScalar
|
|
9467
|
+
*
|
|
9468
|
+
* @param schema
|
|
9469
|
+
* @param objectInfo
|
|
9470
|
+
* @param objectInfoMap
|
|
9471
|
+
* @returns
|
|
9472
|
+
*/
|
|
9473
|
+
function createNewRecordQuery(schema, objectInfo, objectInfoMap) {
|
|
9286
9474
|
let typedScalars = new Set();
|
|
9287
9475
|
let parentRelationshipFields = new Set();
|
|
9288
|
-
|
|
9289
|
-
|
|
9290
|
-
|
|
9291
|
-
|
|
9292
|
-
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9476
|
+
const { apiName, childRelationships, fields: fieldsRepresentation } = objectInfo;
|
|
9477
|
+
typedScalars.add(`${apiName}_Filter`);
|
|
9478
|
+
typedScalars.add(`${apiName}_OrderBy`);
|
|
9479
|
+
const { fields, polymorphicFieldTypeNames } = makeRecordField(values$2(fieldsRepresentation), objectInfoMap, parentRelationshipFields, 'Missing');
|
|
9480
|
+
// handles child relationship
|
|
9481
|
+
const { spanningRecordConnections, typedScalars: spanningConnectionTypedScalars } = makeSpanningRecordConnections(schema, childRelationships, objectInfoMap, parentRelationshipFields);
|
|
9482
|
+
typedScalars = new Set([...typedScalars, ...spanningConnectionTypedScalars]);
|
|
9483
|
+
const recordQueries = `${apiName}(first: Int, where: ${apiName}_Filter, orderBy: ${apiName}_OrderBy, scope: SupportedScopes): ${apiName}Connection\n`;
|
|
9484
|
+
const isServiceAppointment = apiName === 'ServiceAppointment';
|
|
9485
|
+
const recordConnections = /* GraphQL */ `
|
|
9486
|
+
${isServiceAppointment ? `scalar ${apiName.toUpperCase()}_SCOPE` : ''}
|
|
9487
|
+
|
|
9488
|
+
type ${apiName} implements Record {
|
|
9489
|
+
ApiName: String!
|
|
9490
|
+
DisplayValue: String
|
|
9491
|
+
LastModifiedById: IDValue
|
|
9492
|
+
LastModifiedDate: DateTimeValue
|
|
9493
|
+
RecordTypeId(fallback: Boolean): IDValue
|
|
9494
|
+
SystemModstamp: DateTimeValue
|
|
9495
|
+
WeakEtag: Long!
|
|
9496
|
+
_drafts: JSON
|
|
9497
|
+
${fields}
|
|
9498
|
+
${spanningRecordConnections}
|
|
9300
9499
|
}
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9305
|
-
|
|
9306
|
-
|
|
9307
|
-
|
|
9308
|
-
|
|
9309
|
-
|
|
9310
|
-
|
|
9311
|
-
|
|
9312
|
-
|
|
9313
|
-
|
|
9314
|
-
|
|
9315
|
-
|
|
9316
|
-
|
|
9317
|
-
|
|
9318
|
-
|
|
9319
|
-
|
|
9320
|
-
|
|
9500
|
+
|
|
9501
|
+
type ${apiName}Connection {
|
|
9502
|
+
edges: [${apiName}Edge]
|
|
9503
|
+
pageInfo: PageInfo!
|
|
9504
|
+
totalCount: Int!
|
|
9505
|
+
}
|
|
9506
|
+
|
|
9507
|
+
type ${apiName}Edge {
|
|
9508
|
+
node: ${apiName}
|
|
9509
|
+
cursor: String!
|
|
9510
|
+
}
|
|
9511
|
+
|
|
9512
|
+
`;
|
|
9513
|
+
return { recordQueries, recordConnections, typedScalars, polymorphicFieldTypeNames };
|
|
9514
|
+
}
|
|
9515
|
+
/**
|
|
9516
|
+
* Takes the current schema and will extend missing fields to the record.
|
|
9517
|
+
* Assume all scalar fields have already been added, but will extend spanning fields
|
|
9518
|
+
*
|
|
9519
|
+
* extend type Account {
|
|
9520
|
+
* ...spanning parent records
|
|
9521
|
+
* User: User
|
|
9522
|
+
* ...spanning children queries
|
|
9523
|
+
* Users(predicates): UserConnection
|
|
9524
|
+
* }
|
|
9525
|
+
*
|
|
9526
|
+
* @param schema
|
|
9527
|
+
* @param type
|
|
9528
|
+
* @param objectInfo
|
|
9529
|
+
* @param objectInfoMap
|
|
9530
|
+
* @returns
|
|
9531
|
+
*/
|
|
9532
|
+
function extendExistingRecordType(schema, type, objectInfo, objectInfoMap) {
|
|
9533
|
+
// use a set to not allow duplicate scalars causing error(s)
|
|
9534
|
+
let typedScalars = new Set();
|
|
9535
|
+
let parentRelationshipFields = new Set();
|
|
9536
|
+
const existingFields = keys$4(type.getFields());
|
|
9537
|
+
const missingFields = values$2(objectInfo.fields).filter((field) => existingFields.includes(field.apiName) === false);
|
|
9538
|
+
const { fields, polymorphicFieldTypeNames } = makeRecordField(missingFields, objectInfoMap, parentRelationshipFields, 'Cached');
|
|
9539
|
+
const { apiName, childRelationships } = objectInfo;
|
|
9540
|
+
// handles child relationship
|
|
9541
|
+
const { spanningRecordConnections, typedScalars: spanningConnectionTypedScalars } = makeSpanningRecordConnections(schema, childRelationships, objectInfoMap, parentRelationshipFields, existingFields);
|
|
9542
|
+
typedScalars = new Set([...typedScalars, ...spanningConnectionTypedScalars]);
|
|
9543
|
+
const hasExtensions = fields.length > 0 || spanningRecordConnections.length > 0;
|
|
9544
|
+
const recordExtension = hasExtensions
|
|
9545
|
+
? `
|
|
9546
|
+
extend type ${apiName} {
|
|
9547
|
+
${fields}
|
|
9548
|
+
${spanningRecordConnections}
|
|
9549
|
+
}\n`
|
|
9550
|
+
: '';
|
|
9551
|
+
return { recordExtension, typedScalars, polymorphicFieldTypeNames };
|
|
9552
|
+
}
|
|
9553
|
+
/**
|
|
9554
|
+
* Converts child relationships into spanning record connections to be added to record types
|
|
9555
|
+
*
|
|
9556
|
+
* type Record {
|
|
9557
|
+
* Generates -> AccountConnection(first: Int, where: Account_Filter, etc...): AccountConnection
|
|
9558
|
+
* }
|
|
9559
|
+
*
|
|
9560
|
+
* will also generate typed scalars if they have not been added to the existing schema for the spanning connection
|
|
9561
|
+
* example: Account_Filter or Account_OrderBy scalars needed to be defined as predicate types
|
|
9562
|
+
* @param schema
|
|
9563
|
+
* @param childRelationships
|
|
9564
|
+
* @param objectInfoMap
|
|
9565
|
+
* @param existingParentRelationships
|
|
9566
|
+
* @param existingFields
|
|
9567
|
+
* @returns
|
|
9568
|
+
*/
|
|
9569
|
+
function makeSpanningRecordConnections(schema, childRelationships, objectInfoMap, existingParentRelationships, existingFields = []) {
|
|
9570
|
+
let spanningRecordConnections = ``;
|
|
9571
|
+
let typedScalars = new Set();
|
|
9572
|
+
for (const childRelationship of childRelationships) {
|
|
9573
|
+
const { childObjectApiName, relationshipName } = childRelationship;
|
|
9574
|
+
// Only add the relationship if there is relevant objectinfos for it,
|
|
9575
|
+
// otherwise we'd be defining types we cannot satisfy and aren't referenced in
|
|
9576
|
+
// the query.
|
|
9577
|
+
// 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
|
|
9578
|
+
if (existingFields.length > 0 && existingFields.includes(relationshipName)) {
|
|
9579
|
+
continue;
|
|
9580
|
+
}
|
|
9581
|
+
if (objectInfoMap[childObjectApiName] !== undefined &&
|
|
9582
|
+
!existingParentRelationships.has(relationshipName)) {
|
|
9583
|
+
spanningRecordConnections += `${relationshipName}(first: Int, where: ${childObjectApiName}_Filter, orderBy: ${childObjectApiName}_OrderBy, scope: SupportedScopes): ${childObjectApiName}Connection \n`;
|
|
9584
|
+
// if the record type has already been extended then these additional scalars have already been added
|
|
9585
|
+
// to add them again would throw an error
|
|
9586
|
+
const filterScalarType = schema.getType(`${childObjectApiName}_Filter`);
|
|
9587
|
+
if (isScalarType(filterScalarType) === false) {
|
|
9588
|
+
typedScalars.add(`${childObjectApiName}_Filter`);
|
|
9589
|
+
}
|
|
9590
|
+
const orderByScalarType = schema.getType(`${childObjectApiName}_OrderBy`);
|
|
9591
|
+
if (isScalarType(orderByScalarType) === false) {
|
|
9592
|
+
typedScalars.add(`${childObjectApiName}_OrderBy`);
|
|
9321
9593
|
}
|
|
9322
9594
|
}
|
|
9323
|
-
|
|
9324
|
-
|
|
9325
|
-
|
|
9595
|
+
}
|
|
9596
|
+
return { spanningRecordConnections, typedScalars };
|
|
9597
|
+
}
|
|
9598
|
+
/**
|
|
9599
|
+
* Creates scalar and parent relationship fields for a record type
|
|
9600
|
+
*
|
|
9601
|
+
* type RecordName {
|
|
9602
|
+
* generates scalar -> Id: IDValue
|
|
9603
|
+
* generates relationship -> Account: Record
|
|
9604
|
+
* }
|
|
9605
|
+
*
|
|
9606
|
+
* can be used in a type definition or an extension
|
|
9607
|
+
* @param fieldRepresentations
|
|
9608
|
+
* @param objectInfoMap
|
|
9609
|
+
* @param existingParentRelationships
|
|
9610
|
+
* @param recordTypeInSchema
|
|
9611
|
+
* @returns
|
|
9612
|
+
*/
|
|
9613
|
+
function makeRecordField(fieldRepresentations, objectInfoMap, existingParentRelationships, recordTypeInSchema) {
|
|
9614
|
+
const polymorphicFieldTypeNames = new Set();
|
|
9615
|
+
let fields = ``;
|
|
9616
|
+
for (const field of values$2(fieldRepresentations)) {
|
|
9617
|
+
if (!fieldsStaticallyAdded.includes(field.apiName) && recordTypeInSchema === 'Missing') {
|
|
9618
|
+
fields += `${field.apiName}: ${dataTypeToType(field.dataType, field.apiName)}\n`;
|
|
9619
|
+
}
|
|
9620
|
+
//handles parent relationship
|
|
9621
|
+
if (field.relationshipName === null) {
|
|
9622
|
+
continue;
|
|
9623
|
+
}
|
|
9624
|
+
// For spanning parent relationships with no union types
|
|
9625
|
+
if (field.referenceToInfos.length === 1) {
|
|
9626
|
+
const [relation] = field.referenceToInfos;
|
|
9326
9627
|
// Only add the relationship if there is relevant objectinfos for it,
|
|
9327
9628
|
// otherwise we'd be defining types we cannot satisfy and aren't referenced in
|
|
9328
9629
|
// the query.
|
|
9329
|
-
|
|
9330
|
-
|
|
9331
|
-
|
|
9332
|
-
|
|
9333
|
-
|
|
9334
|
-
|
|
9630
|
+
if (objectInfoMap[relation.apiName] !== undefined) {
|
|
9631
|
+
existingParentRelationships.add(field.relationshipName);
|
|
9632
|
+
fields += `${field.relationshipName}: ${relation.apiName}\n`;
|
|
9633
|
+
}
|
|
9634
|
+
// For polymorphic field, its type is 'Record' inteface. The concrete entity type name is saved for field resolving of next phase
|
|
9635
|
+
}
|
|
9636
|
+
else if (field.referenceToInfos.length > 1) {
|
|
9637
|
+
existingParentRelationships.add(field.relationshipName);
|
|
9638
|
+
fields += `${field.relationshipName}: Record\n`;
|
|
9639
|
+
for (const relation of field.referenceToInfos) {
|
|
9640
|
+
if (objectInfoMap[relation.apiName] !== undefined) {
|
|
9641
|
+
polymorphicFieldTypeNames.add(relation.apiName);
|
|
9642
|
+
}
|
|
9335
9643
|
}
|
|
9336
9644
|
}
|
|
9337
|
-
recordQueries += `${apiName}(first: Int, where: ${apiName}_Filter, orderBy: ${apiName}_OrderBy, scope: SupportedScopes): ${apiName}Connection\n`;
|
|
9338
|
-
const isServiceAppointment = apiName === 'ServiceAppointment';
|
|
9339
|
-
recordConnections += /* GraphQL */ `
|
|
9340
|
-
${isServiceAppointment ? `scalar ${apiName.toUpperCase()}_SCOPE` : ''}
|
|
9341
|
-
|
|
9342
|
-
type ${apiName} implements Record {
|
|
9343
|
-
ApiName: String!
|
|
9344
|
-
DisplayValue: String
|
|
9345
|
-
LastModifiedById: IDValue
|
|
9346
|
-
LastModifiedDate: DateTimeValue
|
|
9347
|
-
RecordTypeId(fallback: Boolean): IDValue
|
|
9348
|
-
SystemModstamp: DateTimeValue
|
|
9349
|
-
WeakEtag: Long!
|
|
9350
|
-
_drafts: JSON
|
|
9351
|
-
${fields}
|
|
9352
|
-
}
|
|
9353
|
-
|
|
9354
|
-
type ${apiName}Connection {
|
|
9355
|
-
edges: [${apiName}Edge]
|
|
9356
|
-
pageInfo: PageInfo!
|
|
9357
|
-
totalCount: Int!
|
|
9358
|
-
}
|
|
9359
|
-
|
|
9360
|
-
type ${apiName}Edge {
|
|
9361
|
-
node: ${apiName}
|
|
9362
|
-
cursor: String!
|
|
9363
|
-
}
|
|
9364
|
-
|
|
9365
|
-
`;
|
|
9366
9645
|
}
|
|
9367
|
-
|
|
9368
|
-
return accu + `scalar ${typed}\n`;
|
|
9369
|
-
}, ``);
|
|
9370
|
-
recordConnections += scalars;
|
|
9371
|
-
const polyFieldTypeNameArr = [];
|
|
9372
|
-
polymorphicFieldTypeNames.forEach((fieldType) => polyFieldTypeNameArr.push(fieldType));
|
|
9373
|
-
return { recordQueries, recordConnections, polyFieldTypeNameArr };
|
|
9646
|
+
return { fields, polymorphicFieldTypeNames };
|
|
9374
9647
|
}
|
|
9648
|
+
/**
|
|
9649
|
+
* converts the ObjectInfoRepresentation data type into a defined schema scalar type
|
|
9650
|
+
* @param objectInfoDataType
|
|
9651
|
+
* @param apiName
|
|
9652
|
+
* @returns
|
|
9653
|
+
*/
|
|
9375
9654
|
function dataTypeToType(objectInfoDataType, apiName) {
|
|
9376
9655
|
if (apiName && apiName === 'Id') {
|
|
9377
9656
|
return `ID!`;
|
|
@@ -9413,13 +9692,8 @@ function dataTypeToType(objectInfoDataType, apiName) {
|
|
|
9413
9692
|
return 'String';
|
|
9414
9693
|
}
|
|
9415
9694
|
}
|
|
9416
|
-
function createSchema(objectInfos) {
|
|
9417
|
-
const { typeDefs: typeDefinitions, polyFieldTypeNames } = generateTypeDefinitions(objectInfos);
|
|
9418
|
-
const schema = buildSchema(typeDefinitions);
|
|
9419
|
-
return addResolversToSchema(schema, polyFieldTypeNames);
|
|
9420
|
-
}
|
|
9421
9695
|
|
|
9422
|
-
async function evaluate(config, observers, settings, objectInfos, store, snapshot, draftFunctions) {
|
|
9696
|
+
async function evaluate(config, observers, settings, objectInfos, store, snapshot, cache, draftFunctions) {
|
|
9423
9697
|
const eventEmitter = createCustomAdapterEventEmitter(GRAPHQL_EVAL_NAMESPACE, observers);
|
|
9424
9698
|
// this is only wrapped in a try to execute the event after the result was returned
|
|
9425
9699
|
try {
|
|
@@ -9460,7 +9734,7 @@ async function evaluate(config, observers, settings, objectInfos, store, snapsho
|
|
|
9460
9734
|
const contextValue = createContext(store, objectInfos, eventEmitter, settings, snapshot, draftFunctions);
|
|
9461
9735
|
// We're building this from scratch from each request. If this becomes a
|
|
9462
9736
|
// hotspot we can pull it up and memoize it later
|
|
9463
|
-
const schema =
|
|
9737
|
+
const schema = createSchemaWithCache(objectInfos, cache);
|
|
9464
9738
|
eventEmitter({ type: 'graphql-schema-created' });
|
|
9465
9739
|
// execute document against schema/context
|
|
9466
9740
|
let result = (await execute({
|
|
@@ -12955,6 +13229,8 @@ const replaceDraftIdsInVariables = (variables, draftFunctions, unmappedDraftIDs)
|
|
|
12955
13229
|
}, {});
|
|
12956
13230
|
return newVariables;
|
|
12957
13231
|
};
|
|
13232
|
+
// create the runtime cache for the graphql schema when the factory creates the adapter
|
|
13233
|
+
const graphqlSchemaCache = new CachedGraphQLSchema();
|
|
12958
13234
|
function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio, isDraftId) {
|
|
12959
13235
|
const getCanonicalId = (id) => {
|
|
12960
13236
|
var _a;
|
|
@@ -13028,7 +13304,7 @@ function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio
|
|
|
13028
13304
|
...config,
|
|
13029
13305
|
//need to create another copy of the ast for future writes
|
|
13030
13306
|
query: parse$3(stringify$3(injectedAST)),
|
|
13031
|
-
}, observers, { userId }, objectInfoNeeded, store, nonEvaluatedSnapshot));
|
|
13307
|
+
}, observers, { userId }, objectInfoNeeded, store, nonEvaluatedSnapshot, graphqlSchemaCache));
|
|
13032
13308
|
}
|
|
13033
13309
|
catch (throwable) {
|
|
13034
13310
|
const error = throwable;
|
|
@@ -13057,7 +13333,7 @@ function draftAwareGraphQLAdapterFactory(userId, objectInfoService, store, luvio
|
|
|
13057
13333
|
let { result: rebuildResult, seenRecordIds } = await evaluate({
|
|
13058
13334
|
...config,
|
|
13059
13335
|
query: injectedAST,
|
|
13060
|
-
}, observers, { userId }, objectInfoNeeded, store, originalSnapshot, draftFunctions);
|
|
13336
|
+
}, observers, { userId }, objectInfoNeeded, store, originalSnapshot, graphqlSchemaCache, draftFunctions);
|
|
13061
13337
|
if (!rebuildResult.errors) {
|
|
13062
13338
|
rebuildResult = removeSyntheticFields(rebuildResult, config.query);
|
|
13063
13339
|
}
|
|
@@ -17231,4 +17507,4 @@ register({
|
|
|
17231
17507
|
});
|
|
17232
17508
|
|
|
17233
17509
|
export { getRuntime, registerReportObserver, reportGraphqlQueryParseError };
|
|
17234
|
-
// version: 1.
|
|
17510
|
+
// version: 1.248.0-1f7f01112
|