@salesforce/lds-bindings
Advanced tools
Comparing version 1.112.0 to 1.112.1
import type { Adapter, AdapterRequestContext, ErrorResponse as LuvioErrorResponse, Luvio, Unsubscribe } from '@luvio/engine'; | ||
import type { AstResolver } from '@luvio/graphql-parser'; | ||
import type { GraphQLError } from '@luvio/lwc-luvio'; | ||
import type { GraphQLError, GraphQLInput } from '@luvio/lwc-luvio'; | ||
import type { AdapterMetadata } from './ldsAdapter'; | ||
@@ -31,3 +31,3 @@ interface DataResponse { | ||
*/ | ||
export declare function createGraphQLImperativeAdapter<C, D>(luvio: Luvio, adapter: Adapter<C, D>, metadata: AdapterMetadata, astResolver: AstResolver): ImperativeAdapter<C>; | ||
export declare function createGraphQLImperativeAdapter<C extends GraphQLInput, D>(luvio: Luvio, adapter: Adapter<C, D>, metadata: AdapterMetadata, astResolver: AstResolver): ImperativeAdapter<C>; | ||
export {}; |
@@ -789,11 +789,27 @@ /** | ||
const imperativeAdapterInvoke = (config, requestContext, callback) => { | ||
const ast = astResolver(config.query); | ||
if (ast === undefined) { | ||
callback(createInvalidConfigError()); | ||
return; | ||
let coercedConfig = null; | ||
if ('batchQuery' in config) { | ||
coercedConfig = { | ||
batchQuery: config.batchQuery.map((individualConfig) => ({ | ||
...individualConfig, | ||
query: astResolver(individualConfig.query), | ||
})), | ||
}; | ||
// If any of the configurations are invalid, we bail out of calling the adapter. | ||
if (coercedConfig.batchQuery.some((individualConfig) => individualConfig.query === undefined)) { | ||
callback(createInvalidConfigError()); | ||
return; | ||
} | ||
} | ||
const coercedConfig = { | ||
...config, | ||
query: ast, | ||
}; | ||
else if ('query' in config) { | ||
const ast = astResolver(config.query); | ||
if (ast === undefined) { | ||
callback(createInvalidConfigError()); | ||
return; | ||
} | ||
coercedConfig = { | ||
...config, | ||
query: ast, | ||
}; | ||
} | ||
const snapshotOrPromise = adapter(coercedConfig, requestContext); | ||
@@ -824,11 +840,27 @@ if (snapshotOrPromise === null) { | ||
let unsub; | ||
const ast = astResolver(config.query); | ||
if (ast === undefined) { | ||
callback(createInvalidConfigError()); | ||
return () => { }; | ||
let coercedConfig = null; | ||
if ('batchQuery' in config) { | ||
coercedConfig = { | ||
batchQuery: config.batchQuery.map((individualConfig) => ({ | ||
...individualConfig, | ||
query: astResolver(individualConfig.query), | ||
})), | ||
}; | ||
// If any of the configurations are invalid, we bail out of calling the adapter. | ||
if (coercedConfig.batchQuery.some((individualConfig) => individualConfig.query === undefined)) { | ||
callback(createInvalidConfigError()); | ||
return () => { }; | ||
} | ||
} | ||
const coercedConfig = { | ||
...config, | ||
query: ast, | ||
}; | ||
else if ('query' in config) { | ||
const ast = astResolver(config.query); | ||
if (ast === undefined) { | ||
callback(createInvalidConfigError()); | ||
return () => { }; | ||
} | ||
coercedConfig = { | ||
...config, | ||
query: ast, | ||
}; | ||
} | ||
const snapshotOrPromise = adapter(coercedConfig, requestContext); | ||
@@ -903,2 +935,2 @@ if (snapshotOrPromise === null) { | ||
export { ADAPTER_UNFULFILLED_ERROR, REFRESH_ADAPTER_EVENT, bindWireRefresh, createGraphQLImperativeAdapter, createGraphQLWireAdapterConstructor, createImperativeAdapter, createInfiniteScrollingWireAdapterConstructor, createInstrumentedAdapter, createLDSAdapter, createWireAdapterConstructor, instrument, refresh }; | ||
// version: 1.112.0-725d7e6e3 | ||
// version: 1.112.1-1a0875b1d |
{ | ||
"name": "@salesforce/lds-bindings", | ||
"version": "1.112.0", | ||
"version": "1.112.1", | ||
"license": "SEE LICENSE IN LICENSE.txt", | ||
@@ -34,9 +34,9 @@ "description": "LDS Bindings for SFDC", | ||
"dependencies": { | ||
"@luvio/lwc-luvio": "0.136.5", | ||
"@salesforce/lds-graphql-parser": "^1.112.0" | ||
"@luvio/lwc-luvio": "0.137.1", | ||
"@salesforce/lds-graphql-parser": "^1.112.1" | ||
}, | ||
"devDependencies": { | ||
"@luvio/engine": "0.136.5", | ||
"@luvio/engine": "0.137.1", | ||
"@lwc/engine-core": "2.11.5" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47503
1046
+ Added@luvio/engine@0.137.6(transitive)
+ Added@luvio/lwc-luvio@0.137.1(transitive)
- Removed@luvio/engine@0.136.5(transitive)
- Removed@luvio/lwc-luvio@0.136.5(transitive)
Updated@luvio/lwc-luvio@0.137.1