@apollo/client 4.2.0-alpha.2 → 4.2.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +240 -0
- package/__cjs/cache/core/cache.cjs +1 -1
- package/__cjs/cache/inmemory/entityStore.cjs +3 -3
- package/__cjs/cache/inmemory/entityStore.cjs.map +1 -1
- package/__cjs/cache/inmemory/key-extractor.cjs +1 -1
- package/__cjs/cache/inmemory/policies.cjs +4 -4
- package/__cjs/cache/inmemory/readFromStore.cjs +2 -2
- package/__cjs/cache/inmemory/writeToStore.cjs +4 -4
- package/__cjs/core/ApolloClient.cjs +52 -20
- package/__cjs/core/ApolloClient.cjs.map +1 -1
- package/__cjs/core/ApolloClient.d.cts +159 -22
- package/__cjs/core/ObservableQuery.cjs +7 -7
- package/__cjs/core/ObservableQuery.cjs.map +1 -1
- package/__cjs/core/ObservableQuery.d.cts +20 -1
- package/__cjs/core/QueryManager.cjs +12 -12
- package/__cjs/core/QueryManager.cjs.map +1 -1
- package/__cjs/core/RefetchEventManager.cjs +134 -0
- package/__cjs/core/RefetchEventManager.cjs.map +1 -0
- package/__cjs/core/RefetchEventManager.d.cts +130 -0
- package/__cjs/core/index.cjs +7 -1
- package/__cjs/core/index.cjs.map +1 -1
- package/__cjs/core/index.d.cts +4 -1
- package/__cjs/core/refetchSources/onlineSource.cjs +10 -0
- package/__cjs/core/refetchSources/onlineSource.cjs.map +1 -0
- package/__cjs/core/refetchSources/onlineSource.d.cts +3 -0
- package/__cjs/core/refetchSources/windowFocusSource.cjs +13 -0
- package/__cjs/core/refetchSources/windowFocusSource.cjs.map +1 -0
- package/__cjs/core/refetchSources/windowFocusSource.d.cts +3 -0
- package/__cjs/core/types.d.cts +20 -0
- package/__cjs/invariantErrorCodes.cjs +69 -44
- package/__cjs/link/ws/index.cjs +9 -1
- package/__cjs/link/ws/index.cjs.map +1 -1
- package/__cjs/link/ws/index.d.cts +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useBackgroundQuery.d.cts +1486 -66
- package/__cjs/react/hooks/useLazyQuery.cjs +1 -0
- package/__cjs/react/hooks/useLazyQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLazyQuery.d.cts +366 -40
- package/__cjs/react/hooks/useLoadableQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useLoadableQuery.d.cts +512 -50
- package/__cjs/react/hooks/useMutation.cjs +5 -48
- package/__cjs/react/hooks/useMutation.cjs.map +1 -1
- package/__cjs/react/hooks/useMutation.d.cts +239 -130
- package/__cjs/react/hooks/useQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useQuery.d.cts +590 -41
- package/__cjs/react/hooks/useSubscription.cjs +1 -1
- package/__cjs/react/hooks/useSubscription.cjs.map +1 -1
- package/__cjs/react/hooks/useSubscription.d.cts +2 -2
- package/__cjs/react/hooks/useSuspenseQuery.cjs.map +1 -1
- package/__cjs/react/hooks/useSuspenseQuery.d.cts +754 -46
- package/__cjs/react/internal/cache/QueryReference.cjs +1 -0
- package/__cjs/react/internal/cache/QueryReference.cjs.map +1 -1
- package/__cjs/react/internal/cache/QueryReference.d.cts +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.cjs.map +1 -1
- package/__cjs/react/query-preloader/createQueryPreloader.d.cts +20 -1
- package/__cjs/react/types/types.documentation.d.cts +19 -0
- package/__cjs/version.cjs +1 -1
- package/cache/core/cache.js +1 -1
- package/cache/inmemory/entityStore.js +3 -3
- package/cache/inmemory/entityStore.js.map +1 -1
- package/cache/inmemory/key-extractor.js +1 -1
- package/cache/inmemory/policies.js +4 -4
- package/cache/inmemory/readFromStore.js +2 -2
- package/cache/inmemory/writeToStore.js +4 -4
- package/core/ApolloClient.d.ts +159 -22
- package/core/ApolloClient.js +53 -21
- package/core/ApolloClient.js.map +1 -1
- package/core/ObservableQuery.d.ts +20 -1
- package/core/ObservableQuery.js +7 -7
- package/core/ObservableQuery.js.map +1 -1
- package/core/QueryManager.js +12 -12
- package/core/QueryManager.js.map +1 -1
- package/core/RefetchEventManager.d.ts +130 -0
- package/core/RefetchEventManager.js +126 -0
- package/core/RefetchEventManager.js.map +1 -0
- package/core/index.d.ts +4 -1
- package/core/index.js +3 -0
- package/core/index.js.map +1 -1
- package/core/refetchSources/onlineSource.d.ts +3 -0
- package/core/refetchSources/onlineSource.js +6 -0
- package/core/refetchSources/onlineSource.js.map +1 -0
- package/core/refetchSources/windowFocusSource.d.ts +3 -0
- package/core/refetchSources/windowFocusSource.js +9 -0
- package/core/refetchSources/windowFocusSource.js.map +1 -0
- package/core/types.d.ts +20 -0
- package/core/types.js.map +1 -1
- package/invariantErrorCodes.js +69 -44
- package/link/ws/index.d.ts +1 -1
- package/link/ws/index.js +9 -1
- package/link/ws/index.js.map +1 -1
- package/package.json +3 -7
- package/react/hooks/useBackgroundQuery.d.ts +1486 -66
- package/react/hooks/useBackgroundQuery.js.map +1 -1
- package/react/hooks/useLazyQuery.d.ts +366 -40
- package/react/hooks/useLazyQuery.js +1 -0
- package/react/hooks/useLazyQuery.js.map +1 -1
- package/react/hooks/useLoadableQuery.d.ts +512 -50
- package/react/hooks/useLoadableQuery.js.map +1 -1
- package/react/hooks/useMutation.d.ts +239 -130
- package/react/hooks/useMutation.js +5 -48
- package/react/hooks/useMutation.js.map +1 -1
- package/react/hooks/useQuery.d.ts +590 -41
- package/react/hooks/useQuery.js.map +1 -1
- package/react/hooks/useSubscription.d.ts +2 -2
- package/react/hooks/useSubscription.js +1 -1
- package/react/hooks/useSubscription.js.map +1 -1
- package/react/hooks/useSuspenseQuery.d.ts +754 -46
- package/react/hooks/useSuspenseQuery.js.map +1 -1
- package/react/hooks-compiled/useBackgroundQuery.d.ts +1486 -66
- package/react/hooks-compiled/useBackgroundQuery.js.map +1 -1
- package/react/hooks-compiled/useLazyQuery.d.ts +366 -40
- package/react/hooks-compiled/useLazyQuery.js +1 -0
- package/react/hooks-compiled/useLazyQuery.js.map +1 -1
- package/react/hooks-compiled/useLoadableQuery.d.ts +512 -50
- package/react/hooks-compiled/useLoadableQuery.js.map +1 -1
- package/react/hooks-compiled/useMutation.d.ts +239 -130
- package/react/hooks-compiled/useMutation.js +4 -47
- package/react/hooks-compiled/useMutation.js.map +1 -1
- package/react/hooks-compiled/useQuery.d.ts +590 -41
- package/react/hooks-compiled/useQuery.js.map +1 -1
- package/react/hooks-compiled/useSubscription.d.ts +2 -2
- package/react/hooks-compiled/useSubscription.js +1 -1
- package/react/hooks-compiled/useSubscription.js.map +1 -1
- package/react/hooks-compiled/useSuspenseQuery.d.ts +754 -46
- package/react/hooks-compiled/useSuspenseQuery.js.map +1 -1
- package/react/internal/cache/QueryReference.d.ts +1 -1
- package/react/internal/cache/QueryReference.js +1 -0
- package/react/internal/cache/QueryReference.js.map +1 -1
- package/react/query-preloader/createQueryPreloader.d.ts +20 -1
- package/react/query-preloader/createQueryPreloader.js.map +1 -1
- package/react/types/types.documentation.d.ts +19 -0
- package/react/types/types.documentation.js.map +1 -1
- package/skills/apollo-client/SKILL.md +168 -0
- package/skills/apollo-client/references/caching.md +560 -0
- package/skills/apollo-client/references/error-handling.md +350 -0
- package/skills/apollo-client/references/fragments.md +804 -0
- package/skills/apollo-client/references/integration-client.md +336 -0
- package/skills/apollo-client/references/integration-nextjs.md +325 -0
- package/skills/apollo-client/references/integration-react-router.md +256 -0
- package/skills/apollo-client/references/integration-tanstack-start.md +378 -0
- package/skills/apollo-client/references/mutations.md +549 -0
- package/skills/apollo-client/references/queries.md +416 -0
- package/skills/apollo-client/references/state-management.md +428 -0
- package/skills/apollo-client/references/suspense-hooks.md +773 -0
- package/skills/apollo-client/references/troubleshooting.md +487 -0
- package/skills/apollo-client/references/typescript-codegen.md +133 -0
- package/version.js +1 -1
package/invariantErrorCodes.js
CHANGED
|
@@ -363,7 +363,7 @@ const client = new ApolloClient({
|
|
|
363
363
|
"For more information, please visit: https://go.apollo.dev/c/docs"
|
|
364
364
|
},
|
|
365
365
|
|
|
366
|
-
|
|
366
|
+
72: {
|
|
367
367
|
file: "@apollo/client/core/ApolloClient.js",
|
|
368
368
|
condition: "options.fetchPolicy !== \"cache-and-network\"",
|
|
369
369
|
|
|
@@ -373,7 +373,7 @@ const client = new ApolloClient({
|
|
|
373
373
|
"using a different fetchPolicy, such as cache-first or network-only."
|
|
374
374
|
},
|
|
375
375
|
|
|
376
|
-
|
|
376
|
+
73: {
|
|
377
377
|
file: "@apollo/client/core/ApolloClient.js",
|
|
378
378
|
condition: "options.fetchPolicy !== \"standby\"",
|
|
379
379
|
|
|
@@ -382,7 +382,7 @@ const client = new ApolloClient({
|
|
|
382
382
|
"as cache-first or network-only."
|
|
383
383
|
},
|
|
384
384
|
|
|
385
|
-
|
|
385
|
+
74: {
|
|
386
386
|
file: "@apollo/client/core/ApolloClient.js",
|
|
387
387
|
condition: "options.query",
|
|
388
388
|
|
|
@@ -390,164 +390,164 @@ const client = new ApolloClient({
|
|
|
390
390
|
"in the query option."
|
|
391
391
|
},
|
|
392
392
|
|
|
393
|
-
|
|
393
|
+
75: {
|
|
394
394
|
file: "@apollo/client/core/ApolloClient.js",
|
|
395
395
|
condition: "options.query.kind === \"Document\"",
|
|
396
396
|
message: 'You must wrap the query string in a "gql" tag.'
|
|
397
397
|
},
|
|
398
398
|
|
|
399
|
-
|
|
399
|
+
76: {
|
|
400
400
|
file: "@apollo/client/core/ApolloClient.js",
|
|
401
401
|
condition: "!options.returnPartialData",
|
|
402
402
|
message: "returnPartialData option only supported on watchQuery."
|
|
403
403
|
},
|
|
404
404
|
|
|
405
|
-
|
|
405
|
+
77: {
|
|
406
406
|
file: "@apollo/client/core/ApolloClient.js",
|
|
407
407
|
condition: "!options.pollInterval",
|
|
408
408
|
message: "pollInterval option only supported on watchQuery."
|
|
409
409
|
},
|
|
410
410
|
|
|
411
|
-
|
|
411
|
+
78: {
|
|
412
412
|
file: "@apollo/client/core/ApolloClient.js",
|
|
413
413
|
condition: "!options.notifyOnNetworkStatusChange",
|
|
414
414
|
message: "notifyOnNetworkStatusChange option only supported on watchQuery."
|
|
415
415
|
},
|
|
416
416
|
|
|
417
|
-
|
|
417
|
+
79: {
|
|
418
418
|
file: "@apollo/client/core/ApolloClient.js",
|
|
419
419
|
condition: "optionsWithDefaults.mutation",
|
|
420
420
|
message: "The `mutation` option is required. Please provide a GraphQL document in the `mutation` option."
|
|
421
421
|
},
|
|
422
422
|
|
|
423
|
-
|
|
423
|
+
80: {
|
|
424
424
|
file: "@apollo/client/core/ApolloClient.js",
|
|
425
425
|
condition: "optionsWithDefaults.fetchPolicy === \"network-only\" ||\n optionsWithDefaults.fetchPolicy === \"no-cache\"",
|
|
426
426
|
message: "Mutations only support 'network-only' or 'no-cache' fetch policies. The default 'network-only' behavior automatically writes mutation results to the cache. Passing 'no-cache' skips the cache write."
|
|
427
427
|
},
|
|
428
428
|
|
|
429
|
-
|
|
429
|
+
82: {
|
|
430
430
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
431
431
|
condition: "fetchPolicy === \"standby\"",
|
|
432
432
|
message: "The `variablesUnknown` option can only be used together with a `standby` fetch policy."
|
|
433
433
|
},
|
|
434
434
|
|
|
435
|
-
|
|
435
|
+
84: {
|
|
436
436
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
437
437
|
condition: "this.options.fetchPolicy !== \"cache-only\"",
|
|
438
438
|
message: "Cannot execute `fetchMore` for 'cache-only' query '%s'. Please use a different fetch policy."
|
|
439
439
|
},
|
|
440
440
|
|
|
441
|
-
|
|
441
|
+
85: {
|
|
442
442
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
443
443
|
condition: "updateQuery",
|
|
444
444
|
message: "You must provide an `updateQuery` function when using `fetchMore` with a `no-cache` fetch policy."
|
|
445
445
|
},
|
|
446
446
|
|
|
447
|
-
|
|
447
|
+
89: {
|
|
448
448
|
file: "@apollo/client/core/QueryManager.js",
|
|
449
449
|
message: "QueryManager stopped while query was in flight"
|
|
450
450
|
},
|
|
451
451
|
|
|
452
|
-
|
|
452
|
+
90: {
|
|
453
453
|
file: "@apollo/client/core/QueryManager.js",
|
|
454
454
|
condition: "this.localState",
|
|
455
455
|
message: "Mutation '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
456
456
|
},
|
|
457
457
|
|
|
458
|
-
|
|
458
|
+
91: {
|
|
459
459
|
file: "@apollo/client/core/QueryManager.js",
|
|
460
460
|
message: "Store reset while query was in flight (not completed in link chain)"
|
|
461
461
|
},
|
|
462
462
|
|
|
463
|
-
|
|
463
|
+
94: {
|
|
464
464
|
file: "@apollo/client/core/QueryManager.js",
|
|
465
465
|
condition: "!this.getDocumentInfo(query).hasClientExports || this.localState",
|
|
466
466
|
message: "Subscription '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
467
467
|
},
|
|
468
468
|
|
|
469
|
-
|
|
469
|
+
95: {
|
|
470
470
|
file: "@apollo/client/core/QueryManager.js",
|
|
471
471
|
condition: "this.localState",
|
|
472
472
|
message: "%s '%s' contains `@client` fields but local state has not been configured."
|
|
473
473
|
},
|
|
474
474
|
|
|
475
|
-
|
|
475
|
+
96: {
|
|
476
476
|
file: "@apollo/client/core/QueryManager.js",
|
|
477
477
|
condition: "!hasIncrementalDirective",
|
|
478
478
|
message: "%s '%s' contains `@client` and `@defer` directives. These cannot be used together."
|
|
479
479
|
},
|
|
480
480
|
|
|
481
|
-
|
|
481
|
+
97: {
|
|
482
482
|
file: "@apollo/client/core/QueryManager.js",
|
|
483
483
|
condition: "this.localState",
|
|
484
484
|
message: "Query '%s' contains `@client` fields with variables provided by `@export` but local state has not been configured."
|
|
485
485
|
},
|
|
486
486
|
|
|
487
|
-
|
|
487
|
+
99: {
|
|
488
488
|
file: "@apollo/client/core/QueryManager.js",
|
|
489
489
|
condition: "this.localState",
|
|
490
490
|
message: "Query '%s' contains `@client` fields but local state has not been configured."
|
|
491
491
|
},
|
|
492
492
|
|
|
493
|
-
|
|
493
|
+
100: {
|
|
494
494
|
file: "@apollo/client/core/QueryManager.js",
|
|
495
495
|
condition: "didEmitValue",
|
|
496
496
|
message: "The link chain completed without emitting a value. This is likely unintentional and should be updated to emit a value before completing."
|
|
497
497
|
},
|
|
498
498
|
|
|
499
|
-
|
|
499
|
+
104: {
|
|
500
500
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
501
501
|
condition: "typeof dataId === \"string\"",
|
|
502
502
|
message: "store.merge expects a string ID"
|
|
503
503
|
},
|
|
504
504
|
|
|
505
|
-
|
|
505
|
+
107: {
|
|
506
506
|
file: "@apollo/client/cache/inmemory/key-extractor.js",
|
|
507
507
|
condition: "extracted !== void 0",
|
|
508
508
|
message: `Missing field '%s' while extracting keyFields from %s`
|
|
509
509
|
},
|
|
510
510
|
|
|
511
|
-
|
|
511
|
+
108: {
|
|
512
512
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
513
513
|
condition: "!old || old === which",
|
|
514
514
|
message: `Cannot change root %s __typename more than once`
|
|
515
515
|
},
|
|
516
516
|
|
|
517
|
-
|
|
517
|
+
111: {
|
|
518
518
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
519
519
|
message: "Cannot automatically merge arrays"
|
|
520
520
|
},
|
|
521
521
|
|
|
522
|
-
|
|
522
|
+
112: {
|
|
523
523
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
524
524
|
message: `No fragment named %s`
|
|
525
525
|
},
|
|
526
526
|
|
|
527
|
-
|
|
527
|
+
113: {
|
|
528
528
|
file: "@apollo/client/cache/inmemory/readFromStore.js",
|
|
529
529
|
condition: "!isReference(value)",
|
|
530
530
|
message: `Missing selection set for object of type %s returned for query field %s`
|
|
531
531
|
},
|
|
532
532
|
|
|
533
|
-
|
|
533
|
+
114: {
|
|
534
534
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
535
535
|
message: `Could not identify object %s`
|
|
536
536
|
},
|
|
537
537
|
|
|
538
|
-
|
|
538
|
+
116: {
|
|
539
539
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
540
540
|
message: `No fragment named %s`
|
|
541
541
|
}
|
|
542
542
|
};
|
|
543
543
|
|
|
544
544
|
export const devDebug = {
|
|
545
|
-
|
|
545
|
+
81: {
|
|
546
546
|
file: "@apollo/client/core/ApolloClient.js",
|
|
547
547
|
message: `In client.refetchQueries, Promise.all promise rejected with error %o`
|
|
548
548
|
},
|
|
549
549
|
|
|
550
|
-
|
|
550
|
+
88: {
|
|
551
551
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
552
552
|
message: `Missing cache result fields: %o`
|
|
553
553
|
}
|
|
@@ -625,34 +625,59 @@ export const devWarn = {
|
|
|
625
625
|
"If you are using a split link, ensure each branch contains a terminating link that handles the request."
|
|
626
626
|
},
|
|
627
627
|
|
|
628
|
-
|
|
628
|
+
70: {
|
|
629
|
+
file: "@apollo/client/core/ApolloClient.js",
|
|
630
|
+
message: "`refetchOn` was set on query '%s' but no `RefetchEventManager` is configured on this `ApolloClient` instance. This option has no effect. Pass a `RefetchEventManager` instance to the `refetchEventManager` option on the `ApolloClient` constructor."
|
|
631
|
+
},
|
|
632
|
+
|
|
633
|
+
71: {
|
|
634
|
+
file: "@apollo/client/core/ApolloClient.js",
|
|
635
|
+
message: "`refetchOn` references the '%s' event on query '%s' but no source is configured for it on the `RefetchEventManager`. This event will never fire. Add a source for the event to the `sources` option or call `setEventSource` on the refetch event manager."
|
|
636
|
+
},
|
|
637
|
+
|
|
638
|
+
83: {
|
|
629
639
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
630
640
|
|
|
631
641
|
message: `Called refetch(%o) for query %o, which does not declare a $variables variable.
|
|
632
642
|
Did you mean to call refetch(variables) instead of refetch({ variables })?`
|
|
633
643
|
},
|
|
634
644
|
|
|
635
|
-
|
|
645
|
+
87: {
|
|
636
646
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
637
647
|
message: "Cannot poll on 'cache-only' query '%s' and as such, polling is disabled. Please use a different fetch policy."
|
|
638
648
|
},
|
|
639
649
|
|
|
640
|
-
|
|
650
|
+
92: {
|
|
641
651
|
file: "@apollo/client/core/QueryManager.js",
|
|
642
652
|
message: `Unknown query named "%s" requested in refetchQueries options.include array`
|
|
643
653
|
},
|
|
644
654
|
|
|
645
|
-
|
|
655
|
+
93: {
|
|
646
656
|
file: "@apollo/client/core/QueryManager.js",
|
|
647
657
|
message: `Unknown anonymous query requested in refetchQueries options.include array`
|
|
648
658
|
},
|
|
649
659
|
|
|
650
|
-
|
|
660
|
+
98: {
|
|
651
661
|
file: "@apollo/client/core/QueryManager.js",
|
|
652
662
|
message: '[%s]: Fragments masked by data masking are inaccessible when using fetch policy "no-cache". Please add `@unmask` to each fragment spread to access the data.'
|
|
653
663
|
},
|
|
654
664
|
|
|
655
|
-
|
|
665
|
+
101: {
|
|
666
|
+
file: "@apollo/client/core/RefetchEventManager.js",
|
|
667
|
+
message: "Connected an `ApolloClient` instance to a `RefetchEventManager` that was already connected to a different `ApolloClient`. The previous client has been disconnected and will no longer receive refetch events from this manager."
|
|
668
|
+
},
|
|
669
|
+
|
|
670
|
+
102: {
|
|
671
|
+
file: "@apollo/client/core/RefetchEventManager.js",
|
|
672
|
+
message: "Received '%s' event but an `ApolloClient` instance is not connected to the `RefetchEventManager`. No queries will refetch. Pass the manager to the `refetchEventManager` option on the `ApolloClient` constructor."
|
|
673
|
+
},
|
|
674
|
+
|
|
675
|
+
103: {
|
|
676
|
+
file: "@apollo/client/core/RefetchEventManager.js",
|
|
677
|
+
message: "Received '%s' event but no source is configured for it on the `RefetchEventManager`. No queries will refetch. Add the event to the `sources` option or call `setEventSource`."
|
|
678
|
+
},
|
|
679
|
+
|
|
680
|
+
105: {
|
|
656
681
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
657
682
|
|
|
658
683
|
message: "cache.modify: You are trying to write a Reference that is not part of the store: %o\n" +
|
|
@@ -660,24 +685,24 @@ Did you mean to call refetch(variables) instead of refetch({ variables })?`
|
|
|
660
685
|
"`toReference(object, true)`"
|
|
661
686
|
},
|
|
662
687
|
|
|
663
|
-
|
|
688
|
+
106: {
|
|
664
689
|
file: "@apollo/client/cache/inmemory/entityStore.js",
|
|
665
690
|
|
|
666
691
|
message: "cache.modify: Writing an array with a mix of both References and Objects will not result in the Objects being normalized correctly.\n" +
|
|
667
692
|
"Please convert the object instance %o to a Reference before writing it to the cache by calling `toReference(object, true)`."
|
|
668
693
|
},
|
|
669
694
|
|
|
670
|
-
|
|
695
|
+
109: {
|
|
671
696
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
672
697
|
message: `Inferring subtype %s of supertype %s`
|
|
673
698
|
},
|
|
674
699
|
|
|
675
|
-
|
|
700
|
+
110: {
|
|
676
701
|
file: "@apollo/client/cache/inmemory/policies.js",
|
|
677
702
|
message: `Undefined 'from' passed to readField with arguments %s`
|
|
678
703
|
},
|
|
679
704
|
|
|
680
|
-
|
|
705
|
+
117: {
|
|
681
706
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
682
707
|
|
|
683
708
|
message: `Cache data may be lost when replacing the %s field of a %s object.
|
|
@@ -696,7 +721,7 @@ For more information about these options, please refer to the documentation:
|
|
|
696
721
|
`
|
|
697
722
|
},
|
|
698
723
|
|
|
699
|
-
|
|
724
|
+
118: {
|
|
700
725
|
file: "@apollo/client/cache/core/cache.js",
|
|
701
726
|
message: "Could not identify object passed to `from` for '%s' fragment, either because the object is non-normalized or the key fields are missing. If you are masking this object, please ensure the key fields are requested by the parent object."
|
|
702
727
|
}
|
|
@@ -713,12 +738,12 @@ export const devError = {
|
|
|
713
738
|
message: "The result of getSnapshot should be cached to avoid an infinite loop"
|
|
714
739
|
},
|
|
715
740
|
|
|
716
|
-
|
|
741
|
+
86: {
|
|
717
742
|
file: "@apollo/client/core/ObservableQuery.js",
|
|
718
743
|
message: "Unhandled GraphQL subscription error"
|
|
719
744
|
},
|
|
720
745
|
|
|
721
|
-
|
|
746
|
+
115: {
|
|
722
747
|
file: "@apollo/client/cache/inmemory/writeToStore.js",
|
|
723
748
|
message: `Missing field '%s' while writing result %o`
|
|
724
749
|
}
|
package/link/ws/index.d.ts
CHANGED
package/link/ws/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
1
2
|
import { SubscriptionClient } from "subscriptions-transport-ws";
|
|
2
3
|
import { ApolloLink } from "@apollo/client/link";
|
|
3
4
|
import { __DEV__ } from "@apollo/client/utilities/environment";
|
|
@@ -42,7 +43,14 @@ export class WebSocketLink extends ApolloLink {
|
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
request(operation) {
|
|
45
|
-
return
|
|
46
|
+
return new Observable((observer) => {
|
|
47
|
+
const subscription = this.subscriptionClient
|
|
48
|
+
.request(operation)
|
|
49
|
+
.subscribe(observer);
|
|
50
|
+
return () => {
|
|
51
|
+
subscription.unsubscribe();
|
|
52
|
+
};
|
|
53
|
+
});
|
|
46
54
|
}
|
|
47
55
|
}
|
|
48
56
|
//# sourceMappingURL=index.js.map
|
package/link/ws/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/link/ws/index.ts"],"sourcesContent":["import
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/link/ws/index.ts"],"sourcesContent":["import { Observable } from \"rxjs\";\nimport type { ClientOptions } from \"subscriptions-transport-ws\";\nimport { SubscriptionClient } from \"subscriptions-transport-ws\";\n\nimport { ApolloLink } from \"@apollo/client/link\";\nimport { __DEV__ } from \"@apollo/client/utilities/environment\";\nimport { invariant } from \"@apollo/client/utilities/invariant\";\n\nexport declare namespace WebSocketLink {\n /**\n * Configuration options for creating a `WebSocketLink` instance.\n *\n * @remarks\n *\n * These configuration options are used when creating a `WebSocketLink` without\n * providing an existing `SubscriptionClient` instance. The options are passed\n * directly to the `SubscriptionClient` constructor from the `subscriptions-transport-ws`\n * library.\n */\n export interface Configuration {\n /**\n * The WebSocket endpoint URI to connect to.\n *\n * This should be a valid WebSocket URI (starting with `ws://` or `wss://`)\n * that points to your GraphQL subscription endpoint.\n *\n * @example \"ws://localhost:4000/subscriptions\"\n * @example \"wss://api.example.com/graphql\"\n */\n uri: string;\n\n /**\n * Configuration options passed to the underlying `SubscriptionClient`.\n *\n * These options configure the WebSocket connection behavior, including\n * reconnection settings, connection parameters, and event handlers.\n *\n * For a complete list of available options, see the\n * [supported `subscriptions-transport-ws` options](https://github.com/apollographql/subscriptions-transport-ws/blob/master/src/client.ts#L61-L71).\n */\n options?: ClientOptions;\n\n /**\n * A custom WebSocket implementation to use for the connection.\n *\n * This is useful in environments that don't have native WebSocket support.\n * You can provide a WebSocket polyfill or implementation that conforms to\n * the W3C WebSocket API.\n *\n * @example\n *\n * ```ts\n * import WebSocket from \"ws\";\n *\n * const wsLink = new WebSocketLink({\n * uri: \"ws://localhost:4000/subscriptions\",\n * webSocketImpl: WebSocket,\n * });\n * ```\n */\n webSocketImpl?: any;\n }\n}\n\n/**\n * `WebSocketLink` is a terminating link that executes GraphQL operations over\n * WebSocket connections using the `subscriptions-transport-ws` library. It's\n * primarily used for GraphQL subscriptions but can also handle queries and\n * mutations.\n *\n * @example\n *\n * ```ts\n * import { WebSocketLink } from \"@apollo/client/link/ws\";\n * import { SubscriptionClient } from \"subscriptions-transport-ws\";\n *\n * const wsLink = new WebSocketLink(\n * new SubscriptionClient(\"ws://localhost:4000/subscriptions\", {\n * reconnect: true,\n * })\n * );\n * ```\n *\n * @deprecated `WebSocketLink` uses the deprecated and unmaintained\n * `subscriptions-transport-ws` library. This link is no longer maintained and\n * will be removed in a future major version of Apollo Client. We recommend\n * switching to `GraphQLWsLink`, which uses the [`graphql-ws` library](https://the-guild.dev/graphql/ws) to\n * send GraphQL operations through WebSocket connections.\n */\nexport class WebSocketLink extends ApolloLink {\n private subscriptionClient: SubscriptionClient;\n\n constructor(\n paramsOrClient: WebSocketLink.Configuration | SubscriptionClient\n ) {\n super();\n\n if (__DEV__) {\n invariant.warn(\n \"`WebSocketLink` uses the deprecated and unmaintained `subscriptions-transport-ws` library. This link is no longer maintained and will be removed in a future major version of Apollo Client. We recommend switching to `GraphQLWsLink` which uses the `graphql-ws` library to send GraphQL operations through WebSocket connections (https://the-guild.dev/graphql/ws).\"\n );\n }\n\n if (paramsOrClient instanceof SubscriptionClient) {\n this.subscriptionClient = paramsOrClient;\n } else {\n this.subscriptionClient = new SubscriptionClient(\n paramsOrClient.uri,\n paramsOrClient.options,\n paramsOrClient.webSocketImpl\n );\n }\n }\n\n public request(\n operation: ApolloLink.Operation\n ): Observable<ApolloLink.Result> {\n return new Observable((observer) => {\n const subscription = this.subscriptionClient\n .request(operation)\n .subscribe(observer);\n\n return () => {\n subscription.unsubscribe();\n };\n });\n }\n}\n"],"names":[],"mappings":"AAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA2B,CAA3B,CAAA,CAAA,CAAA,CAAA,CAAiC;AAEjC,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAAmC,CAAnC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA+D;AAE/D,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,EAAE,CAAT,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,EAA2B,CAA3B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA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AAA,CAAA,CAAA,CAAA,EAAa,CAAb,EAAgB,CAAhB,EAAA;gBACQ,CAAR,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoB,CAAC,CAArB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgC,CAAhC,CAAkC;YAC5B,CAAC;QACH,CAAC,CAAC;IACJ;AACF;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apollo/client",
|
|
3
|
-
"version": "4.2.0-alpha.
|
|
3
|
+
"version": "4.2.0-alpha.4",
|
|
4
4
|
"description": "A fully-featured caching GraphQL client.",
|
|
5
5
|
"private": false,
|
|
6
6
|
"keywords": [
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"react",
|
|
10
10
|
"hooks",
|
|
11
11
|
"client",
|
|
12
|
-
"cache"
|
|
12
|
+
"cache",
|
|
13
|
+
"tanstack-intent"
|
|
13
14
|
],
|
|
14
15
|
"author": "packages@apollographql.com",
|
|
15
16
|
"license": "MIT",
|
|
@@ -343,10 +344,5 @@
|
|
|
343
344
|
"**/*.js.map",
|
|
344
345
|
"**/*.d.ts",
|
|
345
346
|
"**/*.json"
|
|
346
|
-
],
|
|
347
|
-
"workspaces": [
|
|
348
|
-
"dist",
|
|
349
|
-
"codegen",
|
|
350
|
-
"scripts/codemods/ac3-to-ac4"
|
|
351
347
|
]
|
|
352
348
|
}
|