@luvio/lwc-luvio 0.99.0 → 0.100.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.
@@ -1,5 +1,6 @@
1
1
  import type { Adapter, Luvio } from '@luvio/engine';
2
- import type { WireAdapterConstructor } from '@lwc/engine-core';
2
+ import type { WireConfigValue, WireContextValue, DataCallback, WireAdapterConstructor } from '@lwc/engine-core';
3
+ import type { AstResolver } from '@luvio/graphql-parser';
3
4
  import { LWCLuvioWireAdapter } from './LWCLuvioWireAdapter';
4
5
  import type { EmittableSnapshot } from './utils/SnapshotState';
5
6
  export declare type GraphQLError = {
@@ -11,6 +12,11 @@ export declare type GraphQLError = {
11
12
  path?: Array<string | number>;
12
13
  extensions?: Record<string, any>;
13
14
  };
15
+ export declare type GraphQLUserInput = {
16
+ query: object;
17
+ variables?: Record<string, string | number | boolean>;
18
+ operationName?: string;
19
+ };
14
20
  export declare type GraphQLResponse = {
15
21
  data: any;
16
22
  errors?: GraphQLError[];
@@ -18,12 +24,19 @@ export declare type GraphQLResponse = {
18
24
  errors: GraphQLError[];
19
25
  };
20
26
  export declare class LWCGraphQLLuvioWireAdapter extends LWCLuvioWireAdapter {
27
+ astResolver: AstResolver;
28
+ constructor(adapter: Adapter<unknown, unknown>, name: string, luvio: Luvio, astResolver: AstResolver, callback: DataCallback);
29
+ update(config: WireConfigValue, _context?: WireContextValue): void;
21
30
  /**
22
31
  * Emits new values to the callback.
23
32
  *
24
33
  * @param snapshot Snapshot to be emitted, if omitted then undefineds will be emitted
25
34
  */
26
35
  protected emit(snapshot?: EmittableSnapshot<GraphQLResponse>): void;
36
+ /**
37
+ * Coerce config before calling the adapter, preserve current behavior otherwise
38
+ */
39
+ protected callAdapter(): void;
27
40
  }
28
41
  /**
29
42
  * Wraps a luvio Adapter in a WireAdapterConstructor that conforms to https://rfcs.lwc.dev/rfcs/lwc/0000-wire-reform#wire-adapter-protocol.
@@ -32,4 +45,4 @@ export declare class LWCGraphQLLuvioWireAdapter extends LWCLuvioWireAdapter {
32
45
  * @param name name to assign to the generated constructor
33
46
  * @param luvio Luvio
34
47
  */
35
- export declare function createGraphQLWireAdapterConstructor(adapter: Adapter<unknown, unknown>, name: string, luvio: Luvio): WireAdapterConstructor;
48
+ export declare function createGraphQLWireAdapterConstructor(adapter: Adapter<unknown, unknown>, name: string, luvio: Luvio, astResolver: AstResolver): WireAdapterConstructor;
@@ -33,7 +33,7 @@ export declare class LWCLuvioWireAdapter implements WireAdapter {
33
33
  /**
34
34
  * Calls the adapter if config has been set and the component is connected.
35
35
  */
36
- private callAdapter;
36
+ protected callAdapter(): void;
37
37
  protected processAdapterResponse(snapshotOrPromise: ReturnType<Adapter<unknown, unknown>>): void;
38
38
  /**
39
39
  * Emits new values to the callback.
@@ -4,7 +4,8 @@ import { unwrap } from 'lwc';
4
4
  const REFRESH_ADAPTER_EVENT = 'refresh-adapter-event';
5
5
  const ADAPTER_UNFULFILLED_ERROR = 'adapter-unfulfilled-error';
6
6
  const USERLAND_PROVISION_ERROR_MESSAGE = "LWC component's @wire target property or method threw an error during value provisioning. Original error:";
7
- const ADAPTER_SNAPSHOT_REJECTED_MESSAGE = 'Luvio wire adapter Promise<Snapshot> rejected. Original error:';
7
+ const ADAPTER_SNAPSHOT_REJECTED_MESSAGE = 'Luvio wire adapter Promise<Snapshot> rejected. Original error:';
8
+ const USERLAND_GRAPHQL_PARSER_ERROR_MESSAGE = 'Use `gql` parser to parse your "query" string';
8
9
 
9
10
  // map of emitted object -> [ adapter name, snapshot ]; snapshot is only undefined for the
10
11
  // initially-emitted { data: undefined, error: undefined } value
@@ -429,6 +430,20 @@ function snapshotToPayload(snapshot) {
429
430
  return payload;
430
431
  }
431
432
  class LWCGraphQLLuvioWireAdapter extends LWCLuvioWireAdapter {
433
+ constructor(adapter, name, luvio, astResolver, callback) {
434
+ super(adapter, name, luvio, callback);
435
+ this.astResolver = astResolver;
436
+ }
437
+ update(config, _context) {
438
+ this.unsubscribe();
439
+ // graphql query AST is passed by reference
440
+ // sanitizing it makes a copy and we lose that reference
441
+ this.config = {
442
+ ...sanitize(config),
443
+ query: config.query,
444
+ };
445
+ this.callAdapter();
446
+ }
432
447
  /**
433
448
  * Emits new values to the callback.
434
449
  *
@@ -446,6 +461,32 @@ class LWCGraphQLLuvioWireAdapter extends LWCLuvioWireAdapter {
446
461
  }
447
462
  }
448
463
  }
464
+ /**
465
+ * Coerce config before calling the adapter, preserve current behavior otherwise
466
+ */
467
+ callAdapter() {
468
+ if (!this.connected || this.config === undefined) {
469
+ return;
470
+ }
471
+ const query = this.config.query;
472
+ // gql returns null for invalid queries
473
+ if (query === null) {
474
+ return;
475
+ }
476
+ const ast = this.astResolver(query);
477
+ if (ast === undefined) {
478
+ // this should only happen if the user didn't parse the query
479
+ if (process.env.NODE_ENV !== 'production') {
480
+ throw new Error(USERLAND_GRAPHQL_PARSER_ERROR_MESSAGE);
481
+ }
482
+ return;
483
+ }
484
+ const snapshotOrPromise = this.adapter({
485
+ ...this.config,
486
+ query: ast,
487
+ });
488
+ this.processAdapterResponse(snapshotOrPromise);
489
+ }
449
490
  }
450
491
  /**
451
492
  * Wraps a luvio Adapter in a WireAdapterConstructor that conforms to https://rfcs.lwc.dev/rfcs/lwc/0000-wire-reform#wire-adapter-protocol.
@@ -454,9 +495,9 @@ class LWCGraphQLLuvioWireAdapter extends LWCLuvioWireAdapter {
454
495
  * @param name name to assign to the generated constructor
455
496
  * @param luvio Luvio
456
497
  */
457
- function createGraphQLWireAdapterConstructor(adapter, name, luvio) {
498
+ function createGraphQLWireAdapterConstructor(adapter, name, luvio, astResolver) {
458
499
  const constructor = function (callback) {
459
- const delegate = new LWCGraphQLLuvioWireAdapter(adapter, name, luvio, callback);
500
+ const delegate = new LWCGraphQLLuvioWireAdapter(adapter, name, luvio, astResolver, callback);
460
501
  this.connect = () => delegate.connect();
461
502
  this.disconnect = () => delegate.disconnect();
462
503
  this.update = (config, context) => delegate.update(config, context);
@@ -3,4 +3,6 @@ import { bindWireRefresh, refreshData } from './LWCLuvioBindings';
3
3
  import { createWireAdapterConstructor } from './LWCLuvioWireAdapter';
4
4
  import { createInfiniteScrollingWireAdapterConstructor } from './LWCInfiniteScrollingLuvioWireAdapter';
5
5
  import { createGraphQLWireAdapterConstructor } from './LWCGraphQLLuvioWireAdapter';
6
+ import type { GraphQLError, GraphQLResponse } from './LWCGraphQLLuvioWireAdapter';
6
7
  export { createWireAdapterConstructor, createInfiniteScrollingWireAdapterConstructor, createGraphQLWireAdapterConstructor, bindWireRefresh, refreshData, REFRESH_ADAPTER_EVENT, ADAPTER_UNFULFILLED_ERROR, };
8
+ export type { GraphQLError, GraphQLResponse };
@@ -2,3 +2,4 @@ export declare const REFRESH_ADAPTER_EVENT = "refresh-adapter-event";
2
2
  export declare const ADAPTER_UNFULFILLED_ERROR = "adapter-unfulfilled-error";
3
3
  export declare const USERLAND_PROVISION_ERROR_MESSAGE = "LWC component's @wire target property or method threw an error during value provisioning. Original error:";
4
4
  export declare const ADAPTER_SNAPSHOT_REJECTED_MESSAGE = "Luvio wire adapter Promise<Snapshot> rejected. Original error:";
5
+ export declare const USERLAND_GRAPHQL_PARSER_ERROR_MESSAGE = "Use `gql` parser to parse your \"query\" string";
@@ -1,5 +1,6 @@
1
1
  import type { Adapter, Luvio } from '@luvio/engine';
2
- import type { WireAdapterConstructor } from '@lwc/engine-core';
2
+ import type { WireConfigValue, WireContextValue, DataCallback, WireAdapterConstructor } from '@lwc/engine-core';
3
+ import type { AstResolver } from '@luvio/graphql-parser';
3
4
  import { LWCLuvioWireAdapter } from './LWCLuvioWireAdapter';
4
5
  import type { EmittableSnapshot } from './utils/SnapshotState';
5
6
  export declare type GraphQLError = {
@@ -11,6 +12,11 @@ export declare type GraphQLError = {
11
12
  path?: Array<string | number>;
12
13
  extensions?: Record<string, any>;
13
14
  };
15
+ export declare type GraphQLUserInput = {
16
+ query: object;
17
+ variables?: Record<string, string | number | boolean>;
18
+ operationName?: string;
19
+ };
14
20
  export declare type GraphQLResponse = {
15
21
  data: any;
16
22
  errors?: GraphQLError[];
@@ -18,12 +24,19 @@ export declare type GraphQLResponse = {
18
24
  errors: GraphQLError[];
19
25
  };
20
26
  export declare class LWCGraphQLLuvioWireAdapter extends LWCLuvioWireAdapter {
27
+ astResolver: AstResolver;
28
+ constructor(adapter: Adapter<unknown, unknown>, name: string, luvio: Luvio, astResolver: AstResolver, callback: DataCallback);
29
+ update(config: WireConfigValue, _context?: WireContextValue): void;
21
30
  /**
22
31
  * Emits new values to the callback.
23
32
  *
24
33
  * @param snapshot Snapshot to be emitted, if omitted then undefineds will be emitted
25
34
  */
26
35
  protected emit(snapshot?: EmittableSnapshot<GraphQLResponse>): void;
36
+ /**
37
+ * Coerce config before calling the adapter, preserve current behavior otherwise
38
+ */
39
+ protected callAdapter(): void;
27
40
  }
28
41
  /**
29
42
  * Wraps a luvio Adapter in a WireAdapterConstructor that conforms to https://rfcs.lwc.dev/rfcs/lwc/0000-wire-reform#wire-adapter-protocol.
@@ -32,4 +45,4 @@ export declare class LWCGraphQLLuvioWireAdapter extends LWCLuvioWireAdapter {
32
45
  * @param name name to assign to the generated constructor
33
46
  * @param luvio Luvio
34
47
  */
35
- export declare function createGraphQLWireAdapterConstructor(adapter: Adapter<unknown, unknown>, name: string, luvio: Luvio): WireAdapterConstructor;
48
+ export declare function createGraphQLWireAdapterConstructor(adapter: Adapter<unknown, unknown>, name: string, luvio: Luvio, astResolver: AstResolver): WireAdapterConstructor;
@@ -33,7 +33,7 @@ export declare class LWCLuvioWireAdapter implements WireAdapter {
33
33
  /**
34
34
  * Calls the adapter if config has been set and the component is connected.
35
35
  */
36
- private callAdapter;
36
+ protected callAdapter(): void;
37
37
  protected processAdapterResponse(snapshotOrPromise: ReturnType<Adapter<unknown, unknown>>): void;
38
38
  /**
39
39
  * Emits new values to the callback.
@@ -8,7 +8,8 @@
8
8
  const REFRESH_ADAPTER_EVENT = 'refresh-adapter-event';
9
9
  const ADAPTER_UNFULFILLED_ERROR = 'adapter-unfulfilled-error';
10
10
  const USERLAND_PROVISION_ERROR_MESSAGE = "LWC component's @wire target property or method threw an error during value provisioning. Original error:";
11
- const ADAPTER_SNAPSHOT_REJECTED_MESSAGE = 'Luvio wire adapter Promise<Snapshot> rejected. Original error:';
11
+ const ADAPTER_SNAPSHOT_REJECTED_MESSAGE = 'Luvio wire adapter Promise<Snapshot> rejected. Original error:';
12
+ const USERLAND_GRAPHQL_PARSER_ERROR_MESSAGE = 'Use `gql` parser to parse your "query" string';
12
13
 
13
14
  // map of emitted object -> [ adapter name, snapshot ]; snapshot is only undefined for the
14
15
  // initially-emitted { data: undefined, error: undefined } value
@@ -433,6 +434,20 @@
433
434
  return payload;
434
435
  }
435
436
  class LWCGraphQLLuvioWireAdapter extends LWCLuvioWireAdapter {
437
+ constructor(adapter, name, luvio, astResolver, callback) {
438
+ super(adapter, name, luvio, callback);
439
+ this.astResolver = astResolver;
440
+ }
441
+ update(config, _context) {
442
+ this.unsubscribe();
443
+ // graphql query AST is passed by reference
444
+ // sanitizing it makes a copy and we lose that reference
445
+ this.config = {
446
+ ...sanitize(config),
447
+ query: config.query,
448
+ };
449
+ this.callAdapter();
450
+ }
436
451
  /**
437
452
  * Emits new values to the callback.
438
453
  *
@@ -450,6 +465,32 @@
450
465
  }
451
466
  }
452
467
  }
468
+ /**
469
+ * Coerce config before calling the adapter, preserve current behavior otherwise
470
+ */
471
+ callAdapter() {
472
+ if (!this.connected || this.config === undefined) {
473
+ return;
474
+ }
475
+ const query = this.config.query;
476
+ // gql returns null for invalid queries
477
+ if (query === null) {
478
+ return;
479
+ }
480
+ const ast = this.astResolver(query);
481
+ if (ast === undefined) {
482
+ // this should only happen if the user didn't parse the query
483
+ if (process.env.NODE_ENV !== 'production') {
484
+ throw new Error(USERLAND_GRAPHQL_PARSER_ERROR_MESSAGE);
485
+ }
486
+ return;
487
+ }
488
+ const snapshotOrPromise = this.adapter({
489
+ ...this.config,
490
+ query: ast,
491
+ });
492
+ this.processAdapterResponse(snapshotOrPromise);
493
+ }
453
494
  }
454
495
  /**
455
496
  * Wraps a luvio Adapter in a WireAdapterConstructor that conforms to https://rfcs.lwc.dev/rfcs/lwc/0000-wire-reform#wire-adapter-protocol.
@@ -458,9 +499,9 @@
458
499
  * @param name name to assign to the generated constructor
459
500
  * @param luvio Luvio
460
501
  */
461
- function createGraphQLWireAdapterConstructor(adapter, name, luvio) {
502
+ function createGraphQLWireAdapterConstructor(adapter, name, luvio, astResolver) {
462
503
  const constructor = function (callback) {
463
- const delegate = new LWCGraphQLLuvioWireAdapter(adapter, name, luvio, callback);
504
+ const delegate = new LWCGraphQLLuvioWireAdapter(adapter, name, luvio, astResolver, callback);
464
505
  this.connect = () => delegate.connect();
465
506
  this.disconnect = () => delegate.disconnect();
466
507
  this.update = (config, context) => delegate.update(config, context);
@@ -3,4 +3,6 @@ import { bindWireRefresh, refreshData } from './LWCLuvioBindings';
3
3
  import { createWireAdapterConstructor } from './LWCLuvioWireAdapter';
4
4
  import { createInfiniteScrollingWireAdapterConstructor } from './LWCInfiniteScrollingLuvioWireAdapter';
5
5
  import { createGraphQLWireAdapterConstructor } from './LWCGraphQLLuvioWireAdapter';
6
+ import type { GraphQLError, GraphQLResponse } from './LWCGraphQLLuvioWireAdapter';
6
7
  export { createWireAdapterConstructor, createInfiniteScrollingWireAdapterConstructor, createGraphQLWireAdapterConstructor, bindWireRefresh, refreshData, REFRESH_ADAPTER_EVENT, ADAPTER_UNFULFILLED_ERROR, };
8
+ export type { GraphQLError, GraphQLResponse };
@@ -2,3 +2,4 @@ export declare const REFRESH_ADAPTER_EVENT = "refresh-adapter-event";
2
2
  export declare const ADAPTER_UNFULFILLED_ERROR = "adapter-unfulfilled-error";
3
3
  export declare const USERLAND_PROVISION_ERROR_MESSAGE = "LWC component's @wire target property or method threw an error during value provisioning. Original error:";
4
4
  export declare const ADAPTER_SNAPSHOT_REJECTED_MESSAGE = "Luvio wire adapter Promise<Snapshot> rejected. Original error:";
5
+ export declare const USERLAND_GRAPHQL_PARSER_ERROR_MESSAGE = "Use `gql` parser to parse your \"query\" string";
@@ -1,5 +1,6 @@
1
1
  import type { Adapter, Luvio } from '@luvio/engine';
2
- import type { WireAdapterConstructor } from '@lwc/engine-core';
2
+ import type { WireConfigValue, WireContextValue, DataCallback, WireAdapterConstructor } from '@lwc/engine-core';
3
+ import type { AstResolver } from '@luvio/graphql-parser';
3
4
  import { LWCLuvioWireAdapter } from './LWCLuvioWireAdapter';
4
5
  import type { EmittableSnapshot } from './utils/SnapshotState';
5
6
  export declare type GraphQLError = {
@@ -11,6 +12,11 @@ export declare type GraphQLError = {
11
12
  path?: Array<string | number>;
12
13
  extensions?: Record<string, any>;
13
14
  };
15
+ export declare type GraphQLUserInput = {
16
+ query: object;
17
+ variables?: Record<string, string | number | boolean>;
18
+ operationName?: string;
19
+ };
14
20
  export declare type GraphQLResponse = {
15
21
  data: any;
16
22
  errors?: GraphQLError[];
@@ -18,12 +24,19 @@ export declare type GraphQLResponse = {
18
24
  errors: GraphQLError[];
19
25
  };
20
26
  export declare class LWCGraphQLLuvioWireAdapter extends LWCLuvioWireAdapter {
27
+ astResolver: AstResolver;
28
+ constructor(adapter: Adapter<unknown, unknown>, name: string, luvio: Luvio, astResolver: AstResolver, callback: DataCallback);
29
+ update(config: WireConfigValue, _context?: WireContextValue): void;
21
30
  /**
22
31
  * Emits new values to the callback.
23
32
  *
24
33
  * @param snapshot Snapshot to be emitted, if omitted then undefineds will be emitted
25
34
  */
26
35
  protected emit(snapshot?: EmittableSnapshot<GraphQLResponse>): void;
36
+ /**
37
+ * Coerce config before calling the adapter, preserve current behavior otherwise
38
+ */
39
+ protected callAdapter(): void;
27
40
  }
28
41
  /**
29
42
  * Wraps a luvio Adapter in a WireAdapterConstructor that conforms to https://rfcs.lwc.dev/rfcs/lwc/0000-wire-reform#wire-adapter-protocol.
@@ -32,4 +45,4 @@ export declare class LWCGraphQLLuvioWireAdapter extends LWCLuvioWireAdapter {
32
45
  * @param name name to assign to the generated constructor
33
46
  * @param luvio Luvio
34
47
  */
35
- export declare function createGraphQLWireAdapterConstructor(adapter: Adapter<unknown, unknown>, name: string, luvio: Luvio): WireAdapterConstructor;
48
+ export declare function createGraphQLWireAdapterConstructor(adapter: Adapter<unknown, unknown>, name: string, luvio: Luvio, astResolver: AstResolver): WireAdapterConstructor;
@@ -33,7 +33,7 @@ export declare class LWCLuvioWireAdapter implements WireAdapter {
33
33
  /**
34
34
  * Calls the adapter if config has been set and the component is connected.
35
35
  */
36
- private callAdapter;
36
+ protected callAdapter(): void;
37
37
  protected processAdapterResponse(snapshotOrPromise: ReturnType<Adapter<unknown, unknown>>): void;
38
38
  /**
39
39
  * Emits new values to the callback.
@@ -8,7 +8,8 @@
8
8
  var REFRESH_ADAPTER_EVENT = 'refresh-adapter-event';
9
9
  var ADAPTER_UNFULFILLED_ERROR = 'adapter-unfulfilled-error';
10
10
  var USERLAND_PROVISION_ERROR_MESSAGE = "LWC component's @wire target property or method threw an error during value provisioning. Original error:";
11
- var ADAPTER_SNAPSHOT_REJECTED_MESSAGE = 'Luvio wire adapter Promise<Snapshot> rejected. Original error:';
11
+ var ADAPTER_SNAPSHOT_REJECTED_MESSAGE = 'Luvio wire adapter Promise<Snapshot> rejected. Original error:';
12
+ var USERLAND_GRAPHQL_PARSER_ERROR_MESSAGE = 'Use `gql` parser to parse your "query" string';
12
13
 
13
14
  // map of emitted object -> [ adapter name, snapshot ]; snapshot is only undefined for the
14
15
  // initially-emitted { data: undefined, error: undefined } value
@@ -388,7 +389,18 @@
388
389
  extendStatics(d, b);
389
390
  function __() { this.constructor = d; }
390
391
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
391
- }
392
+ }
393
+
394
+ var __assign = function() {
395
+ __assign = Object.assign || function __assign(t) {
396
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
397
+ s = arguments[i];
398
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
399
+ }
400
+ return t;
401
+ };
402
+ return __assign.apply(this, arguments);
403
+ };
392
404
 
393
405
  var LWCInfinteScrollingLuvioWireAdapter = /** @class */ (function (_super) {
394
406
  __extends(LWCInfinteScrollingLuvioWireAdapter, _super);
@@ -481,9 +493,18 @@
481
493
  }
482
494
  var LWCGraphQLLuvioWireAdapter = /** @class */ (function (_super) {
483
495
  __extends(LWCGraphQLLuvioWireAdapter, _super);
484
- function LWCGraphQLLuvioWireAdapter() {
485
- return _super !== null && _super.apply(this, arguments) || this;
496
+ function LWCGraphQLLuvioWireAdapter(adapter, name, luvio, astResolver, callback) {
497
+ var _this = _super.call(this, adapter, name, luvio, callback) || this;
498
+ _this.astResolver = astResolver;
499
+ return _this;
486
500
  }
501
+ LWCGraphQLLuvioWireAdapter.prototype.update = function (config, _context) {
502
+ this.unsubscribe();
503
+ // graphql query AST is passed by reference
504
+ // sanitizing it makes a copy and we lose that reference
505
+ this.config = __assign(__assign({}, sanitize(config)), { query: config.query });
506
+ this.callAdapter();
507
+ };
487
508
  /**
488
509
  * Emits new values to the callback.
489
510
  *
@@ -501,6 +522,29 @@
501
522
  }
502
523
  }
503
524
  };
525
+ /**
526
+ * Coerce config before calling the adapter, preserve current behavior otherwise
527
+ */
528
+ LWCGraphQLLuvioWireAdapter.prototype.callAdapter = function () {
529
+ if (!this.connected || this.config === undefined) {
530
+ return;
531
+ }
532
+ var query = this.config.query;
533
+ // gql returns null for invalid queries
534
+ if (query === null) {
535
+ return;
536
+ }
537
+ var ast = this.astResolver(query);
538
+ if (ast === undefined) {
539
+ // this should only happen if the user didn't parse the query
540
+ if (process.env.NODE_ENV !== 'production') {
541
+ throw new Error(USERLAND_GRAPHQL_PARSER_ERROR_MESSAGE);
542
+ }
543
+ return;
544
+ }
545
+ var snapshotOrPromise = this.adapter(__assign(__assign({}, this.config), { query: ast }));
546
+ this.processAdapterResponse(snapshotOrPromise);
547
+ };
504
548
  return LWCGraphQLLuvioWireAdapter;
505
549
  }(LWCLuvioWireAdapter));
506
550
  /**
@@ -510,9 +554,9 @@
510
554
  * @param name name to assign to the generated constructor
511
555
  * @param luvio Luvio
512
556
  */
513
- function createGraphQLWireAdapterConstructor(adapter, name, luvio) {
557
+ function createGraphQLWireAdapterConstructor(adapter, name, luvio, astResolver) {
514
558
  var constructor = function (callback) {
515
- var delegate = new LWCGraphQLLuvioWireAdapter(adapter, name, luvio, callback);
559
+ var delegate = new LWCGraphQLLuvioWireAdapter(adapter, name, luvio, astResolver, callback);
516
560
  this.connect = function () { return delegate.connect(); };
517
561
  this.disconnect = function () { return delegate.disconnect(); };
518
562
  this.update = function (config, context) {
@@ -3,4 +3,6 @@ import { bindWireRefresh, refreshData } from './LWCLuvioBindings';
3
3
  import { createWireAdapterConstructor } from './LWCLuvioWireAdapter';
4
4
  import { createInfiniteScrollingWireAdapterConstructor } from './LWCInfiniteScrollingLuvioWireAdapter';
5
5
  import { createGraphQLWireAdapterConstructor } from './LWCGraphQLLuvioWireAdapter';
6
+ import type { GraphQLError, GraphQLResponse } from './LWCGraphQLLuvioWireAdapter';
6
7
  export { createWireAdapterConstructor, createInfiniteScrollingWireAdapterConstructor, createGraphQLWireAdapterConstructor, bindWireRefresh, refreshData, REFRESH_ADAPTER_EVENT, ADAPTER_UNFULFILLED_ERROR, };
8
+ export type { GraphQLError, GraphQLResponse };
@@ -2,3 +2,4 @@ export declare const REFRESH_ADAPTER_EVENT = "refresh-adapter-event";
2
2
  export declare const ADAPTER_UNFULFILLED_ERROR = "adapter-unfulfilled-error";
3
3
  export declare const USERLAND_PROVISION_ERROR_MESSAGE = "LWC component's @wire target property or method threw an error during value provisioning. Original error:";
4
4
  export declare const ADAPTER_SNAPSHOT_REJECTED_MESSAGE = "Luvio wire adapter Promise<Snapshot> rejected. Original error:";
5
+ export declare const USERLAND_GRAPHQL_PARSER_ERROR_MESSAGE = "Use `gql` parser to parse your \"query\" string";
package/package.json CHANGED
@@ -1,20 +1,44 @@
1
1
  {
2
2
  "name": "@luvio/lwc-luvio",
3
- "version": "0.99.0",
3
+ "version": "0.100.0",
4
4
  "description": "Lightning Web Component bindings for Luvio",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "https://github.com/salesforce/luvio.git",
8
+ "directory": "packages/@luvio/lwc-luvio"
9
+ },
10
+ "license": "MIT",
5
11
  "main": "dist/umd/es2018/lwcluvio.js",
6
12
  "module": "dist/es/es2018/lwcluvio.js",
7
13
  "types": "dist/es/es2018/main.d.ts",
8
- "license": "MIT",
14
+ "files": [
15
+ "dist/"
16
+ ],
9
17
  "scripts": {
10
- "clean": "rm -rf dist src/__tests__/components/generated",
11
18
  "build": "yarn build:lwcluvio && yarn build:component-tests",
12
- "build:lwcluvio": "rollup --config rollup.config.js",
13
19
  "build:component-tests": "luvio generate src/__tests__/components/raml/api.raml src/__tests__/components/generated",
14
- "watch": "yarn build --watch",
20
+ "build:lwcluvio": "rollup --config rollup.config.js",
21
+ "clean": "rm -rf dist src/__tests__/components/generated",
15
22
  "test": "jest",
16
- "test:size": "bundlesize"
23
+ "test:size": "bundlesize",
24
+ "watch": "yarn build --watch"
17
25
  },
26
+ "dependencies": {
27
+ "@luvio/engine": "0.100.0",
28
+ "@lwc/engine-core": "2.11.3"
29
+ },
30
+ "devDependencies": {
31
+ "@luvio/adapter-test-library": "0.100.0",
32
+ "@luvio/cli": "0.100.0",
33
+ "@lwc/jest-preset": "11.2.2"
34
+ },
35
+ "bundlesize": [
36
+ {
37
+ "path": "./dist/es/es2018/lwcluvio.js",
38
+ "maxSize": "5 kB",
39
+ "compression": "brotli"
40
+ }
41
+ ],
18
42
  "nx": {
19
43
  "targets": {
20
44
  "build": {
@@ -28,24 +52,5 @@
28
52
  ]
29
53
  }
30
54
  }
31
- },
32
- "files": [
33
- "dist/"
34
- ],
35
- "devDependencies": {
36
- "@luvio/adapter-test-library": "0.99.0",
37
- "@luvio/cli": "0.99.0",
38
- "@lwc/jest-preset": "11.2.2"
39
- },
40
- "dependencies": {
41
- "@luvio/engine": "0.99.0",
42
- "@lwc/engine-core": "2.11.3"
43
- },
44
- "bundlesize": [
45
- {
46
- "path": "./dist/es/es2018/lwcluvio.js",
47
- "maxSize": "5 kB",
48
- "compression": "brotli"
49
- }
50
- ]
55
+ }
51
56
  }